LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 01: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 01:18 PM.
 
Old 10-06-2006, 01:39 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

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


Reply



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 02:03 PM
help with simple sql statement sekelsenmat Programming 6 08-06-2005 12:01 PM
Installing Programs - A simple question from my simple mind jmp875 Linux - Newbie 6 02-18-2004 09:03 PM
SQL Question jacksmash Programming 7 01-18-2004 10:10 PM
simple question seeking simple answer enzo250gto Linux - Newbie 1 10-27-2001 04:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:45 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration