However, if you are stuck with trailing whitespace in a VARCHAR column, you can remove it through a two step process:
1) alter column type to char
2) alter column type back to varchar.
Another method is to use trim() or ltrim() function with mySQL or phpMyAdmin.
Here is a query which trism whitespace for all entries in a column for which the id >0.
UPDATE tablename set columnname = rtrim(columnname) WHERE id >0;
Yet, another method is to trim whuitespace with PHP. You can add the trim() function to post variables that are inserted into a database so that whitespace is removed.
Example query:
$var = trim($_POST[‘name’]);
$command = “INSERT into tablename VALUES(NULL, ‘$var’)”;
© 2018 ALL Rights Reserved | Sitemap
Vancouver | North Vancouver | Burnaby | Richmond | Coquitlam | Port Coquitlam | Surrey | Langley | Maple Ridge | Mission | Abbotsford | Kamloops | Kelowna | Victoria | Squamish | Whistler | Pemberton