Pagina 1 di 4 1 2 3 ... ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 36
  1. #1

    Estrarre immagine dal database

    Ciao ho inserito un indirizzo di un immagine nel database, ho messo la query per estrarre l'immagine dal database, ma nella stanza della chat non si vedere .. dove ho sbagliato?
    Codice PHP:
    //////////////////////////
    else if($action=="addchr")
    {
      
    $chrnm $_POST["chrnm"];
      
    $pic $_POST["pic"];
      
    $pic mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE name='pic'"));
      
    $chrage $_POST["chrage"];
      
    $maxage $_POST["maxage"];
      
    $chrpst $_POST["chrpst"];
      
    $chrprm $_POST["chrprm"];
      
    $chrcns $_POST["chrcns"];
      
    $chrfun $_POST["chrfun"];
          echo 
    "<head>";
          echo 
    "<title>Admin Tools</title>";
          echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
          echo 
    "</head>";
          echo 
    "<body>";
          echo 
    "<p align=\"center\">";
      if(!
    isadmin(getuid_sid($sid)))
      {
      echo 
    "Permission Denied!";
      }else{
            echo 
    $chrnm;
            echo 
    "
    "
    ;
            
    $pic mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE name='pic'"));
            
    $res mysql_fetch_array (mysql_query("INSERT INTO ibwf_rooms SET name='".$chrnm."', pic='".$pic."', static='1', pass='', mage='".$chrage."', maxage='".$maxage."', chposts='".$chrpst."', perms='".$chrprm."', censord='".$chrcns."' , freaky='".$chrfun."'"));
    echo 
    mysql_error();
            if(
    $res)
          {
            echo 
    "<img src=\"../images/ok.gif\" alt=\"O\"/>Chatroom added successfully";
          }else{
            echo 
    "<img src=\"../images/notok.gif\" alt=\"X\"/>Error adding Chat room";
          }
          } 
    Codice PHP:
    else if ($action=="chat")
               {
    $pic $_POST["pic"];
      
    $mmsg htmlspecialchars(getsetmood(getuid_sid($sid)));
            
    addonline(getuid_sid($sid),"è nella lista delle Chatroom ($mmsg)","index.php?action=chat");
            echo 
    "<head>";
            echo 
    "<title>Lista Chatroom</title>";
            echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
            echo 
    "</head>";
            echo 
    "<body>";
            echo 
    "<p align=\"center\">";
            echo 
    "<img src=\"../images/chat3.gif\" alt=\"\"/>";
            echo 
    popup($sid);
            echo 
    "<p align=\"center\">";
            
    $pic mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE static='1'"));
            
    $rooms mysql_query("SELECT id, name, perms, mage, pic, chposts FROM ibwf_rooms WHERE static='1' AND clubid='0'");
                    while (
    $roommysql_fetch_array($rooms))
            {
            }
            
    $pic mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='1' AND clubid='0'");
            while (
    $roommysql_fetch_array($rooms))

            {
              
              
    /*if(canenter($room[0], $sid))
              {*/
                
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'"));
                echo 
    "<a href=\"chat.php?sid=$sid&amp;rid=$room[0]\">$room[1]($noi[0])</a>
    "
    ;
              
    /*}*/
              
            
    }
            echo 
    "
    "


  2. #2

  3. #3
    lo richiamata qua
    Codice PHP:
     $pic mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE static='1'")); 
            
    $rooms mysql_query("SELECT id, name, perms, mage, pic, chposts FROM ibwf_rooms WHERE static='1' AND clubid='0'"); 
                    while (
    $roommysql_fetch_array($rooms)) 
            { 
            } 
            
    $pic mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='1' AND clubid='0'"); 
            while (
    $roommysql_fetch_array($rooms)) 

  4. #4
    Moderatore di Javascript L'avatar di ciro78
    Registrato dal
    Sep 2000
    residenza
    Napoli
    Messaggi
    8,510
    scusami ma usi sempre la stessa variabile per fare operazioni diverse...parlo della variabile pic
    Ciro Marotta - Programmatore JAVA - PHP
    Preferisco un fallimento alle mie condizioni che un successo alle condizioni altrui.


  5. #5
    e forse ci manca, come si può mettere la variabile?

  6. #6
    Moderatore di Javascript L'avatar di ciro78
    Registrato dal
    Sep 2000
    residenza
    Napoli
    Messaggi
    8,510
    ma esattamente dove vorresti stamparlo? il codice è un bel casino

    in quale degli if?
    Ciro Marotta - Programmatore JAVA - PHP
    Preferisco un fallimento alle mie condizioni che un successo alle condizioni altrui.


  7. #7
    qua
    Codice PHP:
     /*if(canenter($room[0], $sid)) 
              {*/ 
                
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'")); 
                echo 
    "<a href=\"chat.php?sid=$sid&rid=$room[0]\">$room[1]($noi[0])</a>
    "


  8. #8
    No non hai capito.
    In una delle varie query, a $pic assegni il risultato della medesima, ma poi $pic (o comunque un'immagine) non la usi mai...ovvio che non ti stampa alcuna immagine, non gli dici di farlo!


  9. #9
    Moderatore di Javascript L'avatar di ciro78
    Registrato dal
    Sep 2000
    residenza
    Napoli
    Messaggi
    8,510
    ma poi fai un casino.....
    Codice PHP:
     $pic mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE static='1'")); 
            
    $rooms mysql_query("SELECT id, name, perms, mage, pic, chposts FROM ibwf_rooms WHERE static='1' AND clubid='0'"); 
                    while (
    $roommysql_fetch_array($rooms)) 
            { 
            } 
            
    $pic mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='1' AND clubid='0'"); 
            while (
    $roommysql_fetch_array($rooms)) 

            { 
               
              
    /*if(canenter($room[0], $sid)) 
              {*/ 
                
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'")); 
                echo 
    "<a href=\"chat.php?sid=$sid&rid=$room[0]\">$room[1]($noi[0])</a>
    "

              
    /*}*/ 
               
            

            echo 
    "
    "

    è un casino colossale
    Ciro Marotta - Programmatore JAVA - PHP
    Preferisco un fallimento alle mie condizioni che un successo alle condizioni altrui.


  10. #10
    ma un indizio come devo fare?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.