June 28th, 2000, 05:55 PM
-
What do I do to make a page that it shows all of the entries in my MySQL database? I have a simple database thing right now at:
http://tsr4.tsrealm.com/goodtsr/WhereTo/whereto.shtml
After that I want it so a reader can view the all of the entries. Thank you for all the help.
June 29th, 2000, 01:12 AM
-
Edit the following exmple as per your requirment..
populate.php3
<?php
$con=mysql_connect (localhost,username,password);
//connect to the database...
mysql_select_db("databasename",$con);
//select your database..
$result=mysql_query("select * from tablename",$con);
//get all the datas from the table
if ($row = mysql_fetch_array($result)) {
//loop through all your records..
do {
print $row["field1"];
print $row["field2"];
print $row["field3"];
print $row["field4"];
print $row["field5"];
}while($row = mysql_fetch_array($result));
}else{
// no record for your query...
print "No Records!!";
}
?>
------------------
SR -
webshiju.com
"The fear of the LORD is the beginning of knowledge..."
[This message has been edited by Shiju Rajan (edited June 29, 2000).]
June 29th, 2000, 07:54 AM
-
Thank you very much. I will see how this works. Thanks!
------------------
================
-Khill, www.tsrealm.com