I've noticed several threads on here and through Google searches on how to do this, but I need something a little more specific to my needs in order to execute it as I am pretty new to PHP. Hopefully someone can help.
I have a page with 5 Divs (lets just call them 1-5). I have a MYSQL database named 'Users' with columns 'ID' (primary key), 'Member', 'Review' and 'location'.
I would like to randomly populate each Div with rows from this DB and show information from the above mentioned columns.
Can anyone give me guidance on where to begin, or possibly give me sample code that meets the above criteria?
Thanks so much for any help.
Here is a general answer:
1) in PHP establish a connection to you database. something like this:
$connection = mysql_connect($host,$username,$password);
2) query the database:
mysql_select_db($schema, $connection);
$result = mysql_query("Put your sql query here...");
3) loop over the results and echo them to the screen,
while($row = mysql_fetch_array($result))
{
echo $row['mysql_column_name_here'];
}