On Sat, 13 Dec 2003 21:42:29 +0000 (UTC), "Burton Figg" <someone@somewhere.com>
wrote:
[color=blue]
>Before I get in trouble, I have searched extensively for this one, in the
>PHP Docs, online etc.[/color]
Really? The first few pages on Google web and groups searches come up with the
answer.
[color=blue]
>$link = mysql_connect($db,$un,$pw) or die("Could not connect: " .
>mysql_error());[/color]
Here you correctly check for a possible error and stop the script going any
further.[color=blue]
>
> $sql2 = "SELECT * FROM eib.book ORDER BY bookid";
> $op = mysql_query($sql2) ;[/color]
Here you haven't bothered...
[color=blue]
> $num= mysql_numrows($op);[/color]
... resulting in you passing 'false' to mysql_numrows.
[color=blue]
>When I run the page I keep getting this error:[/color]
Warning, actually, you skipped passed the point at which you got an error
(mysql_query) because you didn't check for it
[color=blue]
>Warning: mysql_numrows(): supplied argument is not a valid MySQL result
>resource in C:\Program Files\Apache
>Group\Apache2\htdocs\eib\php\itemadd2.php on line 34[/color]
--
Andy Hassall (andy@andyh.co.uk) icq(5747695) (
http://www.andyh.co.uk)
Space: disk usage analysis tool (
http://www.andyhsoftware.co.uk/space)