Mirey Posted February 23, 2009 Share Posted February 23, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/146522-solved-faulty-like-syntax/ Share on other sites More sharing options...
rhodesa Posted February 23, 2009 Share Posted February 23, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/146522-solved-faulty-like-syntax/#findComment-769239 Share on other sites More sharing options...
Mirey Posted February 23, 2009 Author Share Posted February 23, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/146522-solved-faulty-like-syntax/#findComment-769241 Share on other sites More sharing options...
Maq Posted February 23, 2009 Share Posted February 23, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/146522-solved-faulty-like-syntax/#findComment-769243 Share on other sites More sharing options...
Mirey Posted February 23, 2009 Author Share Posted February 23, 2009 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* Quote Link to comment https://forums.phpfreaks.com/topic/146522-solved-faulty-like-syntax/#findComment-769249 Share on other sites More sharing options...
rhodesa Posted February 23, 2009 Share Posted February 23, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/146522-solved-faulty-like-syntax/#findComment-769251 Share on other sites More sharing options...
Maq Posted February 23, 2009 Share Posted February 23, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/146522-solved-faulty-like-syntax/#findComment-769258 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.