thegreatdanton;1032113 wrote:Hi, i'm just looking for some advice in relation to retrieving data from a MySQL database and displaying in nice looking rows. Basically, what i want to do is call the data into separate rows similar to what is on here. I'm not sure if these are separate divs or rows but it looks pretty cool. I've been searching the net for instructions on displaying MySQL data on a webpage but haven't found a whole lot. I'm just wondering if anyone know how this is done. I know how to call the data but it's just displaying the data is causing the issue. If anyone can point me in the right direction i would really appreciate it.
Thank you
Basically you would have your query to pull the info from the database then to display it all it would be like:
$query = "random query here";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo $row['columnName'] . "<br>";
echo $row['columnName'] . "<br>";
}
Then inside the while loop you would have your format for how the data is to be displayed so you can use div's or table's or such to format it appropriately. This will run through every row that was pulled according to the query, then the $row['columnName'] will be the data for what was in that column for that row its currently on.
A nice read i found was:
http://www.tizag.com/mysqlTutorial/