I've recently entered a couple thousand records into a database. What I'm doing is creating a searchable database for a companies catalog. What has happened is that some of my records have space " " in front of or behind a string of text (or you may say my string includes space). For example in the database table under one field i have a record " LS46". Whenever a query is run to compare an input to see if it equals "LS46" the query says no that's not what I'm looking for and goes onto the next record. What would be the easiest way to work around or remove this space without going into phpMyAdmin and manually editing 2000 records?????
Not sure on the column name, but try something like this. UPDATE my_table SET record_column = TRIM(record_column); Then make sure whatever method you use to populate entries strips off all white space before the record is added. Also, shouldn't be a problem, but make sure you make a backup of the existing data before running this or any query that affects the entire table.