Loading ...
Sorry, an error occurred while loading the content.
 

Re:Re: [php_greek] Mysql Aporia

Expand Messages
  • mariapapa@mycosmos.gr
    To $gen erxetai apo allo arxeio. $gen=$_POST[ genre ]; ... Μερικές φορές, τα λάθη δεν είναι τόσο προφανή. Από ότι
    Message 1 of 5 , Mar 4, 2004
      To $gen erxetai apo allo arxeio.
      $gen=$_POST['genre'];
      ------ Original Message ------
      mariapapa@... wrote:
      > Otan egrapsa to parakatw kwdika, den pira kanena apotelesma.
      > Kserei kaneis pou einai to lathos?
      >
      > $query=mysql_query("select * from moviedb where genre='$gen'");
      > while ($row=mysql_fetch_row($query))
      > {
      > echo("<tr>");
      > echo("<td>Rating: $row[0]</td>");
      > echo("<td>Title : $row[1]</td>");
      > echo("<td>Website $row[2]</td>");
      > echo("</td>");
      > echo("</tr>");
      > }

      ÌåñéêÝò öïñÝò, ôá ëÜèç äåí åßíáé ôüóï ðñïöáíÞ. Áðü üôé âëÝðù, ìÜëëïí ôï
      $gen äåí ïñßæåéò óùóôÜ.
      Ãéá íá ìðïñÝóåéò íá âñåßò êáôáñ÷Þí ôï ðñüâëçìá áõôü, áëëÜ êáé ãéá íá óå
      âïçèÞóù óôá ìåëëïíôéêÜ óïõ, óõíßèéóå ðÜíôá íá âÜæåéò ôï query óïõ óå
      ìåôáâëçôÞ, üðùò åðßóçò êáé íá âÜæåéò ôéò åíôïëÝò ôçò sql óå êåöáëáßá.
      Ôþñá, üðïôå Ý÷åéò ðñüâëçìá, áðëÜ ðñïóèÝôåéò Ýíá:
      echo "<br>Now executing: $query";
      óôïí êþäéêÜ óïõ, êáé êáôáëÞãåéò óôï ðáñáêÜôù:
      $query="SELECT * FROM moviedb WHERE genre='$gen'";
      echo "<br>Now executing: $query";
      $result=mysql_query($query);
      while ($row=mysql_fetch_row($result)) {
      echo("<tr>");
      echo("<td>Rating: $row[0]</td>");
      echo("<td>Title : $row[1]</td>");
      echo("<td>Website $row[2]</td>");
      echo("</td>");
      echo("</tr>");
      }

      Ìüëéò äåéò ôçí Ýîïäï ôïõ scripy üðùò åßíáé ôþñá, áí ÁÊÏÌÁ óïõ
      ðáñïõóéÜæåé ðñüâëçìá, ôüôå êÜíå copy paste ôï query üðùò ôï âëÝðåéò áðü
      ôçí óåëßäá, êáé åêôÝëåóÝ ôï áðåõèåßáò óôçí mysql óïõ, ìå ôïí client óïõ.
      ÐïëëÝò öïñÝò ÷ñåéÜóôçêå íá ôï êÜíù óå ðåñßðëïêá queries... ¼ëï êáé êÜôé
      îå÷íÜù... ;-)


      - ÃéÜííçò ÓôïÀëçò



      --
      ÅëëçíéêÞ PHP mailing list
      Yahoo! Groups Links
    • Giannis Stoilis
      ... Δεν είπες όμως τι σου δείχνει το echo $query... Έστω ένα echo $gen, τι σου βγάζει; - Γιάννης
      Message 2 of 5 , Mar 4, 2004
        mariapapa@... wrote:
        > To $gen erxetai apo allo arxeio.
        > $gen=$_POST['genre'];

        Δεν είπες όμως τι σου δείχνει το echo $query... Έστω ένα echo $gen, τι
        σου βγάζει;


        - Γιάννης Στοΐλης
      • mariapapa@mycosmos.gr
        to echo $gen mou vgazei p.x. Drama i Sci-Fi ktl To echo ( Now executing $query ); mou vgazei Now executing Select * from moviedb where genre= Sci-Fi ; To
        Message 3 of 5 , Mar 5, 2004
          to "echo $gen" mou vgazei p.x. Drama i Sci-Fi ktl
          To echo ("Now executing $query"); mou vgazei "Now executing Select * from moviedb where genre='Sci-Fi'";

          To provlima mou einai (den thimamai an sas to eipa apo tin arxi) oti to output tou select einai polles seires kai thelw na paragw enan pinaka pou h html morfi tou na miazei me tin mysql morfi tou.
          Mipws sto mysql_fetch_row iparxei to provlima kai thelei mysql_fetch_array.
          To dokimasa kai to fetcharray kai pairnw afta pou den exw. :)

          Maria
          ------ Original Message ------
          mariapapa@... wrote:
          > To $gen erxetai apo allo arxeio.
          > $gen=$_POST['genre'];

          Äåí åßðåò üìùò ôé óïõ äåß÷íåé ôï echo $query... ¸óôù Ýíá echo $gen, ôé
          óïõ âãÜæåé;


          - ÃéÜííçò ÓôïÀëçò




          --
          ÅëëçíéêÞ PHP mailing list
          Yahoo! Groups Links
        Your message has been successfully submitted and would be delivered to recipients shortly.