March 3rd, 2000, 06:37 PM
I have a serious problem with PHP / MySQL not processing my queries correctly. For example, say I have 2 tables, "companies" and "categories", where "type" is a list of 10 or so types (small, big, large etc.). It has 2 columns, "type" and "price," both of which are string values.
The "companies" table has a lot of columns. It also contains "type" column, indicating which company is of which type. The values in this column is the same as in "categories" table.
Now, I want php to return a MySQL query result of roughly: "Select price from type where type = $companies["type"]" .. In other words, I want a "price" value for whatever type this company belongs to.
Please help if you can-- anyone. I need to get this done in about a week... considering that there's still a ton left to do, please let me know if you're interested in working on this. I'm willing to hire anyone who's interested.
March 3rd, 2000, 07:21 PM
in this case you need to join the tables. you can use something like
select categories.price from companies,categories where (
(companies.type=categories.type) and (companies.name = "Name of the Company"))
this should give you the desired result.
I am also willing to work as a consultant. Please mail me separately for that.
Hope you find the abobe info useful...
[This message has been edited by amodi (edited March 03, 2000).]