mysql_fetch_array() is misbehaving - Please help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    mysql_fetch_array() is misbehaving - Please help

    Hey guys i'm using this code
    PHP Code:
    if(!$row mysql_fetch_array($catQueryMYSQL_BOTH))
      
    $images->showError();
    else while(
    $row)
      print 
    $row['category'].'<br>'
    and my script is showing only one DB entry and repeat it forever.
    libra.wen.ru

    #2
    maybe this ....
    PHP Code:
    $i 0;
    while(
    $row mysql_fetch_object($catQuery))

         print 
    $row->category.'<br>'
         
    $i++;
    }
    if  ( ! 
    $i)  $images->showError(); 
    Last edited by i0nutzxp; 30.07.11, 10:36.
    <?php unlink('World/Europe/Romania.country'); ?>

    Comment


      #3
      Thanks bro, The solution was
      PHP Code:
      while($row mysql_fetch_array($catQueryMYSQL_BOTH)) 
      Even though i still don't understand it but yeah it solved my problem
      libra.wen.ru

      Comment


        #4
        while(resource) => while the resource exists (infinite loop when you dont delete from resource)
        while($row = resource) => while the resource is copied to variabile $row
        while($row == resource) => while resource is equal with row

        PS: use MYSQL_ASSOC OR MYSQL_NUM instead MYSQL_BOTH
        <?php unlink('World/Europe/Romania.country'); ?>

        Comment

        Working...
        X