php - Only 1 row return in MySQL select query -


Why this happens when I use selected queries in the MySQL database using PDO only it gives 1 row When do I really need it?

This is my code

  $ data = $ connectionStrings- & gt; Prepare ("Select from animals"); $ Data- & gt; Executed (); $ Information = $ data- & gt; Fetch (); Return information;  

This is because you are using fetch () instead of fetchAll () Are ALL ()

$ data = $ connectionStyping-> & gt; Prepare ("Select from animals"); $ Data- & gt; Executed (); $ Information = $ data- & gt; Fatch ALL (); Return information;

Read more here:


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -