Hmmm, without knowing the errors, the data, the tables, etc...
In very generic form...
Code: Select all
<?php
// Make your connection to the DB.
$link = mysql_connect("localhost", "db_username", "db_password");
// Choose your DB.
$db = mysql_select_db("db_name", $link);
// Your SQL statement.
$sql = "SELECT * from your_table";
$result = mysql_query($sql, $link) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$id = $rowї"$id"];
$field1 = $rowї"$field1"];
//Note this is in a while loop so for each record you will get the following line. Format away here...
echo "Now you can display $id and/or $field1 here";
}
//close your db connection.
mysql_close($link);
?>
This is not taking an security into account, assuming the db is on localhost, etc.
Good luck.