Jump to content

[SOLVED] SELECT * FROM table_name WHERE column= `` Not working!?!?


Recommended Posts

My code is not working:

SELECT * FROM table_name WHERE column= ``

I am trying to find all the entries in my table "table_name", that have not yet any value defined for "column"

 

-I know this is the query, because I use $query = text, then I echo'd, printed, and echo'd with htmlspecialchars(), and all were the same.

-My database does have a table called "table_name", i 5X checked that in php my admin

-one of the columns in this table is 100% sure "column"

-this table is populated with well over 200 entries, and they are all empty in that column

 

The table-column settings:

-NULL: No, DEFAULT: None

-when I added the entries in the first place, I did so like this:

..., '', ...

-so in VALUES() the corresponding spot was just empty, with two collons ' and ', no space inbetween

 

Can anyone advise me how I can make this work? Thanks!

 

 

EDIT: and yes, the query does have a ";" at the end, I forgot to put that here.

backticks are only used around column and table names, and even then they are not necessary unless you have a column or table name that is a reserved word (and that's only for mysql, and you shouldn't be naming your column/table names reserved words anyways, bad practice).  IOW in practice you should never have to use backticks.  Though some editors like to sneak them in, change quotes to backticks and stuff.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.