Jump to content

Wierd as hell


jaymc

Recommended Posts

I have made a php script that reads a text file, explodes bits of data from it and puts it into a database

 

One of the fields is `manager`

 

The managers name is retrieved from the txt file and dumped in the database, works fine!!

 

Now, I tried to use a query to return all results WHERE `manager` = 'their name'

 

It didnt work, the code was fine, I tested it with other fields and it was fine, just not manager

 

After further investigation, using phpmyadmin I edited the row, then saved it, so basically it updated the row but with all the same info

 

It then started working!!!

 

With that in mind I can only assume its a character set issue

 

For example, a normal space by pressing the same bar looks exactly the same as doin ALT0160, however, they are not both spaces, the ALT0160 is an invisible character

 

Maybe its something like that...

 

But yeh, in phpmyadmin I can see

 

manager = their name

 

but when I search for it, it comes back with no results, I even copied it from phpmyadmin to make sure it was the correct characters, but didnt work

 

I then clicked on edit, clicked on save, and then it works coming up in the searches, so obviously phpmyadmin is converting the character set to the correct one..

 

I know its crazy, but I hope ive explained it well enough

 

Feedback would be great!

Link to comment
Share on other sites

I can think of two possibilities:

 

1) Leading or trailing spaces. Perhaps your script to parse the data and insert into the database is not trimming the values first. Perhaps, opening the record for editing in PMA and then saving is triming the spaces.

 

2) A character isssue as you have described. You should be able to test for that by parsing one of the values down to individual characters and then echoing the character code to the page.

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.