Jump to content

[SOLVED] faulty like syntax?


Mirey

Recommended Posts

This is driving me insane.

 

My sql statement it

 

SELECT stock_code FROM stock WHERE web_details LIKE '%slim%'

 

yet it still returns items that slim is not in. The crazy thing, it only returns a few items, not the entire database.

 

Anyone got any ideas?

 

thanks

Link to comment
Share on other sites

code looks fine to me. double check to make sure you are connecting to the correct database and the script you are editing and running are definitely the same.

 

yeah, I have done - I went in to run it from phpmyadmin as well, it just doesn't make sense to me :s there must be some link, i can't figure out as it doesn't return everything :s

 

Thanks anyways

Link to comment
Share on other sites

If it's returning something then it's a valid SQL statement.

 

Like rhodesa said, check against the script connection and the actual database to make sure you're connecting to the correct one.  Make sure you're looking at the correct table.  You mentioned "the entire database" but you're only looking in one table (stock).

 

There's not much more we can help you with unless you post a some more relevant code.

Link to comment
Share on other sites

apparently it connects to a dif server D:

sorry for wasting your time guys, thanks a lot =]

 

that shouldn't have taken so long to work out :/

 

*cowers in shame*

 

no worries...i wouldn't have had the tip of checking your server connection if i hadn't experienced the sample problem myself  ;)

Link to comment
Share on other sites

apparently it connects to a dif server D:

sorry for wasting your time guys, thanks a lot =]

 

that shouldn't have taken so long to work out :/

 

*cowers in shame*

 

At least it was SELECTing and not DELETing  :P

Link to comment
Share on other sites

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.