php foreach with multidimensional array

后端 未结 12 1619
一向
一向 2020-11-27 05:10

I\'m developing a php app that uses a database class to query mySQL.

the class is here: http://net.tutsplus.com/tutorials/php/real-world-oop-with-php-and-mysql/

12条回答
  •  春和景丽
    2020-11-27 05:27

    Wouldn't a normal foreach basically yield the same result as a mysql_fetch_assoc in your case?

    when using foreach on that array, you would get an array containing those three keys: 'id','firstname' and 'lastname'.

    That should be the same as mysql_fetch_assoc would give (in a loop) for each row.

提交回复
热议问题