Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
codeCode: Select all
<html>
<body>
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("test",$db);
// display individual record
if ($id) {
$result = mysql_query("SELECT * FROM employees WHERE id=$id",$db);
$myrow = mysql_fetch_array($result);
printf("First name: %s\n<br>", $myrow["name"]);
printf("Bio: %s\n<br>", $myrow["bio"]);
} else {
// show employee list
$result = mysql_query("SELECT * FROM employees",$db);
if ($myrow = mysql_fetch_array($result)) {
// display list if there are records to display
do {
printf("<a href="%s?id=%s">%s</a><br>\n", $_SERVER['PHP_SELF'], $myrow["id"], $myrow["name"]);
} while ($myrow = mysql_fetch_array($result));
} else {
// no records to display
echo "Sorry, no records were found!";
}
}
?>
</body>
</html>a little what the heck happened might be helpful to me as wellNotice: Undefined variable: id in c:\program files\easyphp\www\example5.php on line 15
feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]