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

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -