I just started doing this MySQL business Friday, I've looked at various sites and their code and the only thing I find is a bunch of error-riddled code.
I simply would like to make my links load the record info on a new page, you know like loading an indivual ID on a page...here's the code I have so far...
// Connecting, selecting database
$link = mysql_connect("localhost", "root", "cinqmars")
or die("Could not connect");
print "<b>Connected to the database:</b> mydb";
mysql_select_db("mydb")
or die("Could not select database.");
// Performing SQL query
$result = mysql_query("SELECT id, first, last, address, position FROM employees");
// Assign the variables into the array:
while(list($id, $first, $last, $address, $postition) = mysql_fetch_row($result)) {
//Now do what you want:
echo "<table width=\"80%\"><tr>\n"
."<td><a class=\"main\"
href=\"db-test.php?id=$id\">$first "," $last</a></td></table>\n";
}
// Closing connection
mysql_close($link);