Jump to content

query returns no results


hyster

Recommended Posts

example of of my table

idname

file

info

14qwerty

bat.zip

blah

 

when i run the query

SELECT * FROM `obarep` WHERE FILE LIKE 'bat.zip'

 

it runs ok but no result is returned. if i use "not like" i get a result.

 

im assuming the . in bat.zip is causing the problems but i dont no were to go from here. i need the file name in the database.

 

 

Link to comment
Share on other sites

bat.zip will be a $var when its working but the $var didnt work so i used a fixed term just to get it working.

i tried = 'bat.zip' at first as i want an exact match.

i then tried 'like' and a few variations but it still would not work. i even tried like 'b' and other single letters and still nothing.

 

i could only get a result using 'not like'

Link to comment
Share on other sites

How did the data value get inserted into your table? You likely have a new-line (cr/lf) or a null byte (zero) or even a space stored as part of the data.

 

You will need to find out what is causing the value in your column to not match the expected value you are using in your query.

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.