sager29 Posted July 7, 2010 Share Posted July 7, 2010 MySQL 5.0.18 PHP 4.3.11 I'm trying to select * rows from my db where the name equals a specific name. So far it works great, but when I try to query for a particular artist, Z.S. Liang, it doesn't find any rows. I know the rows exist, I can see them. Here is my code, in short: $category='Z.S. Liang'; $query="select * from $dbtable where DISPLAY_NAME='$category' order by GW_PRODUCTid desc"; I've tried escaping the periods but that doesn't seem to work. Any ideas would be greatly appreciated. Sorry if this is supposed to be in the PHP section, didn't want to double post. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/207033-having-trouble-using-periods-in-a-mysql-query/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 7, 2010 Share Posted July 7, 2010 Your data and query works for me (just tested.) You likely have some non-printing characters as part of the data, such as a cr/lf. How did the data get put into the table? Quote Link to comment https://forums.phpfreaks.com/topic/207033-having-trouble-using-periods-in-a-mysql-query/#findComment-1082629 Share on other sites More sharing options...
sager29 Posted July 8, 2010 Author Share Posted July 8, 2010 I put the data in using a .csv file. However, I can query the entire table and see it exactly as I'm entering it. I've even gone as far as copying the data from the field and doing a direct query with it. I've decided to make an exception for that artist, using IF statements and %wildcards% and it seems to work. I just wish that I could understand the problem for future reference. Thanks for your reply though, if you have any other ideas I'd love to hear them. thanks again Quote Link to comment https://forums.phpfreaks.com/topic/207033-having-trouble-using-periods-in-a-mysql-query/#findComment-1082799 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.