I've trying to edit my existing code with the TRIM statement & can't get it to work. I have a form users enter information into & submit it to a MySQL database. One of the fields is last_name. If a user types in O'Reilly or Jiu-Jons as a last name or even has trailing blank spaces at the end, I need the TRIM statement to take out the ' or - or the trailing blank space. I've researched:
and am still as lost as a duck in the desert......could someone help me out?
$strSQL = "INSERT INTO info
( '" . $last_name . "')";