How do I loop through a PHP array containing data returned from MySQL?

后端 未结 6 1860
野趣味
野趣味 2020-12-21 18:10

Ok I have a table with a few fields. One of the fields is username. There are many times where the username is the same, for example:

6条回答
  •  醉话见心
    2020-12-21 18:26

    $qry=mysql_query(select * where username='bob');

    if(mysql_num_rows($qry))

    {

     while($row=mysql_fetch_array($qry,MSQL_NUM))
    
     {
    
            echo $row[0]."  ".$row[1]."  ".$row[2]."
    "; }

    }

提交回复
热议问题