May 23, 2012, 10:47:12 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: follow us on twitter @dotdragnet
Home
Help
Search
Login
Register
DotDragnet
>
The Tech Side
>
Tech stuff
>
Another SQL question
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Another SQL question (Read 252 times)
Charisma Bypass
Hero Member
Posts: 556
Another SQL question
«
on:
February 22, 2011, 10:14:04 AM »
$p_query = mysql_query("
select pd.p_id, pd.p_name, c2p.c_p_status
from p2c left join c2p on p2c.p_id = c2p.p_id and c2p.c_id = '1'
where pd.p_id = p2c.p_id and pd.l_id = '2'
and p2c.c_id = '3'");
What I need to add into the mix is another table "s" - and from that get the value of s.s_n_p_p and s.s
The link will be on s.p_id which is the same as pd.p_id and p2c.p_id and c2p.p_id. It is very possible that no record would exist in "s" that matches.
I'm struggling, any help would be greatly appreciated with a paypal beer or two.
Logged
Charisma Bypass
Hero Member
Posts: 556
Re: Another SQL question
«
Reply #1 on:
February 22, 2011, 10:46:02 AM »
Write it down, have a cup of coffee, and it becomes clear.
pd left join s on pd.products_id = s.products_id,
D'oh.
Sorry chaps.
Logged
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> General Discussion
=> Jee's Forum of Appalling Jokes
-----------------------------
The Creative Side
-----------------------------
=> Arty stuff
=> Photography
=> On the web
-----------------------------
The Tech Side
-----------------------------
=> Tech stuff
=> Hardware & Software
-----------------------------
The Business Side
-----------------------------
=> Anything business related
-----------------------------
The Practical Side
-----------------------------
=> Practical Advice
DotDragnet
>
The Tech Side
>
Tech stuff
>
Another SQL question
Loading...