When I look at myphpadmin it says no index defined. What does that mean? How do I add an index to the following script when I add tables to the database?
An index is like a book index: it allows for fast searching based on the key provided. Your table should have a primary key (which is automatically an index). This could be a column or a group of columns.
However, it looks like you are very mistaken in your understanding of relational databases. Let's take a look at your CREATE TABLE statement:
CREATE TABLE categories
(
solid varchar(15),
electronics varchar(15),
apparel varchar(15)
)
So, each category has a "solid", an "electronics" and an "apparel". This does not make sense. I am not sure what is "solid" in this context, but "electronics" and "apparel" sound like categories to me, not attributes of a category.
Why do I need a ! in front of $con in the if statement?
If you read the PHP manual concerning [man]mysql_connect/man, you will find that it returns false if the attempt to connect failed. As such, $con would be false, thus !$con would be true, hence it is logical to display a message informing the user of the problem.
If you have no idea what ! means, read the PHP manual on Logical Operators.