[thelist] MySQL Table fields

Andrew Maynes andrew at humanbehaviour.co.uk
Thu Jan 23 14:57:01 CST 2003


I like this error code it reallt confuses things :)

This is now what I have and it works until I put the INNER JOIN in ?

$result=mysql("$DBName","SELECT Items.ItemSKU, Items.ItemName,
Items.ItemDescription, Items.ItemCost, Items.Category, Items.ShippingCost,
Items.ItemID, Category.Category FROM Items, Category INNER JOIN category, items
ON Items.Category = Category.Category WHERE ItemID='$II'");

With the inner joins in lower case I get this error:

You have an error in your SQL syntax near ' items ON Items.Category =
Category.Category WHERE ItemID='2'' at line 1Select an item:


When the INNER JOIN is Category, Items I get this error

Not unique table/alias: 'Category'Select an item:

When I take this out:
INNER JOIN Category, Items ON Items.Category = Category.Category

I dont get any any errors but I am at the beginning again.

Am I doing something reallt stupid or is it all wrong?

I tried the mysql_query and it just kept on showing errors.  All the tables are
in lower case so its strange that the first letter in the table name creates a
problem when it is lower case in the query.  Is this normal?

Andrew







More information about the thelist mailing list