jaymc Posted April 21, 2007 Share Posted April 21, 2007 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! Quote Link to comment Share on other sites More sharing options...
Psycho Posted April 21, 2007 Share Posted April 21, 2007 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. Quote Link to comment 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.