I am trying to get to grips with managing data in mysql, am am currentky
working on deleting records
I have worked through a turorial - no problems, but now I am trying to apply
it to my own database, I am getting the error
Warning: Supplied argument is not a valid MySQL result resource in .... on
line 14
I cannot see what is causing it - if anyone can it would be much
appreciated.
thanks
Nathan
For clarity/brevity I have cut the page back to what i beleive to be the
relivant part. Code for page is:-
<html>
<body>
<?php
$db = mysql_connect("localhost", "username", "pasword");
mysql_select_db("catalogue",$db);
$result = mysql_query("SELECT * FROM SECTIONS",$db);
while ($myrow = mysql_fetch_array($result)) {
printf("<a href=\"%s?section_id=%s\">%s %s</a> \n", $PHP_SELF,
$myrow["section_id"], $myrow["section_name"], $myrow["section"]);
printf("<a href=\"%s?id=%s&delete=yes\">(DELETE)</a><br>", $PHP_SELF,
$myrow["section_id"]);
}
?>
</body>
</html>
SQL for the table is
CREATE TABLE SECTIONS (
section_name varchar(25) NOT NULL,
section_id tinyint(3) unsigned DEFAULT '0' NOT NULL auto_increment,
section char(1) NOT NULL,
PRIMARY KEY (section_id),
UNIQUE section (section_name, section_id, section)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]