View Single Post
Old 07-01-2007, 5:11 PM   #2
rush
 
rush's Avatar
 
Posts: n/a
My Photos: ()

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default PHP Help From Book

"Nic, Val, Vic, Mara, Ecs & Alc" <ilove@spam.org> wrote in message
news:3f3f6c04$0$960$cc9e4d1f@news.dial.pipex.com.. .
> Does anyone know what's wrong with this code? I just started learning php

&
> mysql from a book and this code is copied directly from it, yet it still
> fails to work... I always get the following error:
>
> Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
> resource in /home/tjc/public_html/results.php on line 40


Probably your db query is not ok, try inserting echo "|$query|"; after the
following line.

> $query = "SELECT * FROM books WHERE ".$searchtype." LIKE

'%".$searchterm."%'" ;

probably is either $searchtype or $searchterm something silly or empty.
There are a few possible causes, like for instance the page from which you
are posting does not have variables seachterm or searchtype in the form, or
they are named differently. Or you are trying to access the page without
posting

rush
--
http://www.templatetamer.com/



  Reply With Quote