i am trying to save image data in mysql using blob format these are inserted and retrieved correctly using php i have a problem , i need to create a separate sql file for certain data which includes blob data when i try to import the sql file it is not able to import the blob data
include 'database.inc.php';
if (isset($_FILES['sqlfile']) && !empty($_FILES['sqlfile'])) {
$filename=$_FILES['sqlfile']['name'];
$tmp_filename=$_FILES['sqlfile']['tmp_name'];
move_uploaded_file($tmp_filename, $filename);
$file_content=file_get_contents($filename);
$commands = explode(';',trim($file_content));
foreach ($commands as $command) {
if(mysql_query($command)){
//header('Location: '.$_SERVER['HTTP_REFERER']);
} else {
//echo 'Failed to import with following command <br/>'.$command;
echo mysql_error();
}
}
}