# Selecting from multiple tables in SQL

**URL:** https://forum.kirupa.com/t/selecting-from-multiple-tables-in-sql/240794
**Category:** programming
**Created:** [October 6, 2007, 8:31am UTC](https://forum.kirupa.com/t/selecting-from-multiple-tables-in-sql/240794 "2007-10-06T08:31:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![spazzblaster](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@spazzblaster](https://forum.kirupa.com/u/spazzblaster)
#### Post date: [October 6, 2007, 8:31am UTC](https://forum.kirupa.com/t/selecting-from-multiple-tables-in-sql/240794/1 "2007-10-06T08:31:45Z")

</div>

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:

```php
$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!
