in PHP, I’m using mysql_query($querystring) to insert some information into a table.
However, when I look at the MySQL Query Logs, it shows that gibberish is getting added:
MySQL Log:
INSERT INTO database.table
SET
`col1` = '0^@0^@:^@0^@0^@:^@1^@8',
`col2` = '3^@8^@0',
`col3` = '3^@6^@8',
`col4` = '1^@2'
When I do a var_dump() on $querystring, everything looks fine, no ^@ are appended.
PHP var_dump() – Note: I just made up the 333 number.
string(333) "INSERT INTO database.table
SET
`col1` = '00:00:18',
`col2` = '380',
`col3` = '368',
`col4` = '12'"
However, the MySQL logs are showing the ^@. Is there any way to strip the ^@ from the $querystring?
The values stored in the database are ’00:00:00′ (the default value for that field), ‘3’, ‘3’, and ‘1’. Col1 is of type date, and Col2-4 are smallint(5).
Ended up being a Encoding Issue.
Fix: