Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

problem with inserting a forward slash in mysql table

I got problem inserting the string "AM/PM" to my mySQL table

$timeFormat = mysql_real_escape_string($_POST['timeFormat']);

$sql="
UPDATE profiles
SET firstName = '$firstName', lastName = '$lastName', language = '$language', timeFormat = '$timeFormat'
WHERE profileId = '$profileId'
";
mysql_query($sql) or die('Error: '.mysql_error());

There is no error, but the table is only showing AM/ ??

Edit:

When I echo the $sql I get:

UPDATE profiles SET firstName = 'Johan', lastName = 'Lund', language = 'English', timeFormat = 'AM/PM' WHERE profileId = '27'

And, yes I have searched the web in a very long time before asking this question. Probably if you have any link from Stackoverflow. I have already overlooked it.

like image 437
einstein Avatar asked Feb 24 '26 16:02

einstein


1 Answers

nothing wrong with this insert.
it's matter of how do you see the query result.

like image 84
Your Common Sense Avatar answered Feb 27 '26 04:02

Your Common Sense



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!