LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-06-2006, 02:11 PM   #1
joelhop
Member
 
Registered: Mar 2004
Location: Pennsylvania::USA
Distribution: Fedora Core 6
Posts: 100

Rep: Reputation: 15
Smile Simple SQL question


I am using Php and MySQL. I'm trying to do a query that searches for entires that have a NULL value in the used field.

$query = "SELECT * FROM codes WHERE used = NULL";


Several entries do have a null value, however I am not returning anything with my query. Is there a specific syntax for search for = NULL or != NULL fields?

Would it just be is NULL and not NULL? something like that?

Thanks,
Karl

Last edited by joelhop; 10-06-2006 at 02:18 PM.
 
Old 10-06-2006, 02:39 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 59
try 'is' instead of '='
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu Fluxbox simple question, simple answer? generallimptoes Linux - Software 3 09-26-2005 03:03 PM
help with simple sql statement sekelsenmat Programming 6 08-06-2005 01:01 PM
Installing Programs - A simple question from my simple mind jmp875 Linux - Newbie 6 02-18-2004 10:03 PM
SQL Question jacksmash Programming 7 01-18-2004 11:10 PM
simple question seeking simple answer enzo250gto Linux - Newbie 1 10-27-2001 05:08 AM


All times are GMT -5. The time now is 01:05 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration