New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
mysqli fetch_all help
Now I am facing a problem with mysqli in php.
Error message: Call to undefined method mysqli_result::fetch_all()
The problem is I did not find any working example of fetch_all. Could anyone give an example?
I know I could run a while using fetch_assoc. But I would like to know how to use fetch_all
Thanks
Comments
As you're using an older version of PHP, did you compile in mysqlnd?
I can't think of a reason to ever use fetch_all(), but there's an example here: http://php.net/manual/en/mysqli-result.fetch-all.php
PHP 5 >= 5.3.0
What's your PHP version?
Edit: Also:
MySQL Native Driver Only
Available only with mysqlnd.
5.3.8
You'll need to install mysqlnd:
http://www.php.net/manual/en/mysqlnd.install.php
I run into little trouble running a SQL Query inside
while($row=$mysqli->fetch_assoc){
run another query here
}
So I was trying to put every result of my first query into a array.
oh, mysqlnd is another module to install. If so, for compatibility, I better avoid it.
Why don't you join or union instead? Or are they mutually exclusive data?