Can anyone please help me to understand me how to use array – passed to ajax – to output and style database information in html?
PHP sample:
For example: I have an array called $query.
while ($row=mysql_fetch_array($query)) {
echo '<div>'.$row["name"].'</div>';
echo '<div>'.$row["surname"].'</div>';
echo '<div>'.$row["address"].'</div>';
}
JQuery:
What if i pass that same $query array to ajax (javascript)? How can i output it in similar way that i did with php? For example: to print each name, surname and address inside separate divs.
...success: function(data) { ? }
Thanks 🙂
__