Jump to content

Display all entrys in MYsql database on php page


alcoholic1

Recommended Posts

First make a connection with the following code

[code]// Make a MySQL and database connection
mysql_connect("LOCALHOST","USERNAME","PASSWORD") or die(mysql_error());
mysql_select_db("TABLE") or die(mysql_error());[/code]

and edit the uppercase settings.

then use

[code]while($row = mysql_fetch_array( $result )) {
[/code]

then say you have a field called 'blah' and one called 'blah2'
you use the code
[code]echo $row['blah'];
echo $row['blah2'];[/code]


or you can even do something like
[code]  $blah = $row['blah'];
  $blah2 = $row['blah2'];[/code]

and use the new variables for the data. don't forget to close the while loop with another '}'

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.