Hi,
I was wondering if anyone could help me out. I’m very new to using SQL and PHP. I’ve created a database for a Fireworks website with each table in the database containing information for each different type of firework - sparklers, firecrackers, rockets, etc.
I am in the middle of creating a search bar to search the product database and everything was going fine until I tried to instruct the FROM statement to select from ALL OF THE TABLES when a search is performed.
I’ve done a lot of reading and everything I’ve read indicates that I should just be able to list the tables with a comma in between them after the FROM statement, but this is returning an error. So is trying to use the INNER JOIN command.
If I take out all of the table names except for one it works fine, it’s only when I try to select from multiple tables. Here is the SELECT statement that I am using:
$sql = "SELECT * FROM firecrackers, rockets, cakes WHERE MATCH (name, catagory, description, tagline) AGAINST ('$criteria')";
Can anyone tell me what it is I’m doing wrong?
Thanks for any help!