Re: Search script query doesn't work
| From: | Andrian Pervazov | Date: | Sat, 08 Jul 2000 17:24:05 +0000 |
| Subject: | Re: Search script query doesn't work | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5550@lists.php.net to get a copy of this message | ||
Fates wrote:
>
> The main problem is that the query doesn't work, I think it has something to do with the
> variables values from the form: A minor problem is when I bring up the page it already performs a
> search without having to click on submit.
/snip/
>
> $query = "SELECT * FROM albums, songs WHERE '$category' = '$testband'
> AND songs.albumid = albums.albumid";
Try removing the quotes around $category - the way it is now MySQL
considers it a variable, not a table name.
If you don't want to run the query on loading the page, check whether
the form has been submitted and run it only if so.
Andrian