Jump to content

Having trouble using periods in a mysql query


sager29

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.