Dismounted
59.***.***.***
Display A Database
Display A Database
*NOTE* This is an add-on to my DB Connection Snippet ("http://www.phpcentral.com/51-connecting-mysql-database.html")!
Place this code where you want the database to be displayed.
<?
mysql_pconnect($db_host, $db_user, $db_pass);
mysql_select_db($db_name);
$result = mysql_query("SELECT * FROM $db_table");
while($r = mysql_fetch_array($result))
{
$data_name = $r['field_name'];
}
echo ("" . $data_name . "");
?>
Pretty much self-explanatory.
penguinmama
12.***.***.***
So this just displays EVERYTHING in the database.
If you want to display just parts, do a specific select.
$result = mysql_query("SELECT column1, column2, column3 FROM $db_table");
:)
Dismounted
59.***.***.***
Yes, just change the query to display different things.
penguinmama;158:
So this just displays EVERYTHING in the database.
If you want to display just parts, do a specific select.
$result = mysql_query("SELECT column1, column2, column3 FROM $db_table");
:)
Yes you have to have some good knowlege of Sql also if you need to play with all around and that was my first thing which i learn