![]() |
Need php/mysql query help, inside!
I have a few tables (osc)
Code:
This is important: If you need any more info, please ask or ping me on icq 125586484 / msn inpresif/@/hotmail . com Code:
SELECT cs.categories_storename,cs.categories_id,c.categories_id,c.parent_id,p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, pd.products_description, |
Extra info:
This is inside the table cs Code:
categories_stores_id categories_id categories_storename Code:
categories_id categories_image parent_id sort_order date_added last_modified categories_status |
Code:
SELECT cs.categories_storename,cs.categories_id,c.categories_id,c.parent_id,p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, pd.products_description, |
Quote:
You added just this right?? AND p2c.categories_id = '<category id number goes here>' Is there a way to get this cid number in this same query? As you could see, this is also in the categories_stores table. Do we need a small query first to get these category ID's, or is that double-up? |
uh... You want all products/categories from store "name.co.uk" ??
Then you will need to use IN() [...] AND p2c.categories_id IN( SELECT cs.categories_id FROM categories_stores cs WHERE cs.categories_storename = 'name.co.uk' ) [...] |
Hi,
maybe because your using left join which is an outer join which means it includes record that doesn't have a partner or related field including NULL. Better use inner join. I think that is what you expect. |
Okay, looks like Giga's solution did the trick.
Tried them both. Reading up on those Joins now. @Sysk: Would mysql give an error when it does not support subqueries? I did not get one and i like the way that could work. I have all kinds of run-arounds for stuff, like this;) Code:
$parentId = explode("_",$cPath); Code:
... A-M-A-T-E-U-R One new problem though, the following gives zero results, but it should give everything there's in the dbase. No specified store means, we sell everything;) Code:
SELECT DISTINCT p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, pd.products_description, Code:
... |
I already got that last remark fixed by putting it in an if-then clause
|
All times are GMT -7. The time now is 09:09 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123