mysql - Retrieving more than one row of data using PHP -
I am trying to create a function that runs the query that returns all the data located in my MySQL database .
My current code only gives a line of data (is 7)
function_community_get () {$ this-> load-> Database (); $ Sql = 'Select from Employee'; $ Query = $ this- & gt; Db- & gt; Query ($ sql); $ Data = $ query- & gt; Line (); $ This- & gt; Feedback ($ data, 200); } I thought it was "$ data = $ query-> line ();" Although I tried to change the "row" from "array" but it does not work, the text is designed to come out as plain text so that I can manipulate it using jQuery template.
Thanks for your help in advance.
You have to put the result in a loop at a time. Something on the lines of this
function_smart_get () {$ this- & gt; Load-> Database (); $ Sql = 'Select from Employee'; $ Query = $ this- & gt; Db- & gt; Query ($ sql); While ($ data = $ query- & gt; line ()) {$ this- & gt; Feedback ($ data, 200); }}
Comments
Post a Comment