I have some data that I am trying to insert into a table that is retrieved from another table in mysql which has the data type BINARY(20).
The data extracted is in the variable $binary['hash'];
/l÷ˆ8Ô]¿\µK<þeû
When I try to insert into another table using PDO like below, (the column hash is BINARY(20) also)
$q = $dbc -> prepare("INSERT INTO table VALUES (hash) VALUES (?)");
$q -> execute(array($binary['hash']));
I get an error like such,
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES ('\0/l÷ˆ8Ô]¿\µK<þeû')' at line 1'
I notice that the value of $binary['hash'] is different and it is not inserting!
How can I get this working?