Hi;
I have the following:
mysql> select * from categoriesProducts as c inner join relationshipProducts
as r on c.ID = r.Child inner join categoriesProducts as p on r.Parent = p.ID
where p.Category = prodCat2;
ERROR 1054 (42S22): Unknown column 'prodCat2' in 'where clause'
mysql> describe categoriesProducts;
+----------+-----------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+-----------------+------+-----+---------+----------------+
| ID | int(3) unsigned | NO | PRI | NULL | auto_increment |
| Category | varchar(40) | YES | | NULL | |
| Parent | varchar(40) | YES | | NULL | |
+----------+-----------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
mysql> select * from categoriesProducts;
+----+----------+--------+
| ID | Category | Parent |
+----+----------+--------+
| 1 | prodCat1 | None |
| 2 | prodCat2 | None |
+----+----------+--------+
2 rows in set (0.00 sec)
So I'm at a loss. No, 'prodCat2' isn't a column, but I don't understand how
I specified that in my query. Please advise.
TIA,
Victor