php - Insert file into mysql database as varbinary datatype
Get the solution ↓↓↓Solution:
Need to use double quotes
Try this Query :
$sql = $db->query("INSERT INTO `proposal` (`id_mhs`, `id_status`, `judul_proposal`, `abstraksi_proposal`, `nama_file_proposal`, `file_proposal`) VALUES ('".$id_mhs."','2','".$judul_proposal."', '".$abstraksi_proposal."', '".$file_proposal."', (CAST('".$content."' AS VARBINARY(100)))");
Answer
Solution:
i solved this problem. this is my query :
$sql = $db->query("INSERT INTO `proposal` (`id_mhs`, `id_status`, `judul_proposal`, `abstraksi_proposal`, `nama_file_proposal`, `file_proposal`) VALUES ('$id_mhs', $id_status, '$judul_proposal', '$abstraksi_proposal', '$file_proposal', CONVERT('$content', BINARY))");
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: ftp_put(): can't open that file: no such file or directory
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.