New to PHP/mySql and having trouble inserting and retrieving binary data. I have a mySql table called usr_pressdata. The field 'BinDat' is of type mediumblob.
$dat = $this->parseOverview($sql);
// $dat is now a binary string
$datsql = "Update usr_pressdata Set BinDat = " . $dat;
$datresult = mysql_query($datsql, $this -> conn) or die(mysql_error());
$getdat = "Select * from usr_pressdata";
$getdatresult = mysql_query($getdat, $this -> conn) or die(mysql_error());
$row = mysql_fetch_array( $getdatresult );
$retval = $row['BinDat'];
In this example my goal is that $retval == $dat but it does not. I suspect that my query string $datsql is incorrect. Can someone correct this example code? Thank you.