I have an excel sheet for insert statement, in excel sheet there is no white spaces, but when inserted in mysql database. the insertion is successful but the data have white spaces in it.
how to excluded?
Regards:
I have an excel sheet for insert statement, in excel sheet there is no white spaces, but when inserted in mysql database. the insertion is successful but the data have white spaces in it.
how to excluded?
Regards:
Either http://php.net/trim or http://php.net/str_replace?
As in: str_replace ( ' ' , '' , $str );
For a different answer I.E. SQL based.
SELECT TRIM(' leading trailing ')
To use in an INSERT you could
INSERT INTO Users (forename, surname) VALUES (TRIM(' ASHLEY '), TRIM(' MEDWAY '))
copy queries from excel to notepad/textpad and remove white/tab spaces by CTRL+H. and run the the statements. basically excel adds tab white spaces between columns. in case of strings, tab spaces are added in between double quotes("").