I am using ajax
to pull some data from a PHP
script I created. The PHP
script queries the database for user information and comment information. There will be a lot of comments and I am trying to figure out how to return 3
records (LIMIT 3)
- this is what I have:
foreach($results->fetch_assoc() as $key => $db_value) {
//$array[$key] = $db_value;
print_r($results->fetch_assoc());
}
$results->fetch_assoc()
returns a single record set. I was messing around and couldn't figure it out.
What I am trying to do is have 3 arrays returned to the HTML
doc via json_encode so that I can read it and display it. Can anyone help?