Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

select statment and left join

General discussions related to php

Moderators: macek, egami, gesf

select statment and left join

Postby rochellecanale » Thu Sep 27, 2012 9:21 pm

hey guys i have a data like this in my table:

username | downline
sample1 | 2
sample2 | 3
sample3 | null
sample4 | null
sample5 | null

this is an output from my left join. Now all i want is to select only the user where the downline is not null.
so it means that i want show sample1 and sample2 from my view. I tried to use the != null but it gaves me 0. Can you help me guys?
rochellecanale
New php-forum User
New php-forum User
 
Posts: 4
Joined: Thu Sep 27, 2012 7:49 pm

Re: select statment and left join

Postby szalek01 » Sun Sep 30, 2012 12:42 pm

try:
WHERE `fild` IS NOT NULL
szalek01
New php-forum User
New php-forum User
 
Posts: 4
Joined: Thu Sep 27, 2012 2:58 pm


Return to PHP General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron