scarhand Posted February 29, 2008 Share Posted February 29, 2008 when i insert binary data into my database it is supposed to be inserting the exact same data in 2 places, but its not. this data i am inserting is "h—ù×Ç6šª\0UOÛ¹ð+`" (binary), notice the backtick on the end of it... now when i insert this value using this script: <?php $hash = mysql_real_escape_string($hash); mysql_query("INSERT INTO test (hash) VALUES ('$hash')"); ?> using that inserts "h—ù×Ç6šª\0UOÛ¹ð+`" which is 100% correct, notice the backtick is still there now when i insert this value using this script: <?php $columns = '`hash`'; $values = '\'' . mysql_escape_string($hash) . '\''; @mysql_query("REPLACE INTO `test2` ($columns) VALUES ($values);"); ?> using that inserts "h—ù×Ç6šª\0UOÛ¹ð+" (notice the backtick is gone from the end of this one, and its only 19 characters in length as opposed to 20) the difference between the table 'test' and 'test2' is 'test2' is a HEAP type also, 'test' uses char(20) binary as its column for 'hash', where 'test2' uses varchar(20) binary as its column for 'hash'.. any help would be great. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.