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

Link to comment
Share on other sites

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

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.