Looping Through SQL Results in PHP - Not getting Entire Array

后端 未结 2 857
一向
一向 2020-12-10 19:07

I\'m probably missing something easy, but I seem to be blocked here... I have a MySQL database with two tables and each table has several rows. So the goal is to query the

2条回答
  •  没有蜡笔的小新
    2020-12-10 19:51

    One common way to loop through results is something like this:

    $result = mysql_query($query);
    while ($row = mysql_fetch_assoc($result)) {
        print_r($row);
        // do stuff with $row
    }
    

    Check out the examples and comments on PHP.net. You can find everything you need to know there.

提交回复
热议问题