Hi Group,
I've not posted here before, so I hope I'm not breaking
any policies.
Here is some code I'm using to try and select individual
records from
mySQL database..
<?php
include("dbinfo.inc.php") ;
mysql_connect(localhost,$username,$password);
mysql_select_db($database) or die("Unable to
select Database");
//display individual record
if ($id) {
$result = mysql_query("SELECT * FROM Artist WHERE
ID='$id'");
$myrow = mysql_fetch_array($result);
printf("Code: %s\n<br>",
$myrow["Code"]);
printf("Name: %s\n<br>",
$myrow["Name"]);
} else {
// show employee list
$result = mysql_query("SELECT * FROM
Artist");
if ($myrow = mysql_fetch_array($result)) {
// display list if there are records to display
do {
printf("<a
href=\"%s?id=%s\">%s
%s</a><br>\n", $PHP_SELF,
$myrow["ID"], $myrow["Code"],
$myrow["Name"]);
} while ($myrow = mysql_fetch_array($result));
} else {
// no records to display
echo "Sorry, no records were found!";
}
}
?>
Whenever i click on a link,i get the same page of all of my
records
instead of the individual record that i clicked on.
Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP-Masters" group.
To post to this group, send email to PHP-Masters googlegroups.com
To unsubscribe from this group, send email to
PHP-Masters-unsubscribe googlegroups.com
For more options, visit this group at http://gro
ups.google.com/group/PHP-Masters
-~----------~----~----~----~------~----~------~--~---
|