echo "<form action='uploadck.php' method=post
enctype='multipart/form-data' >
Name : <input type=text name=t1><br>
Select one ID :<select name=id>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
</select><br>
Upload this file: <input type=file name='file_up'>
<input type=submit value='Upload Image'></FORM>";
require 'config.php'; // database connection file.
require 'menu.php';
$id=$_POST['id'];
$student=$_POST['t1'];
$photo= fopen($_FILES[file_up][tmp_name], 'rb');
$query="insert into student_profile(id,student,profile_photo)
values(:id,:student,:profile_photo)";
$step=$dbo->prepare($query);
$step->bindParam(':id',$id,PDO::PARAM_INT, 3);
$step->bindParam(':student',$student,PDO::PARAM_STR, 10);
$step->bindParam(':profile_photo',$photo,PDO::PARAM_LOB);
if($step->execute()){
echo " Data with Photo is added ";
}
else{
echo " Not able to add data please contact Admin ";
print_r($step->errorInfo());
}
PDO Blob column adding , updating & displaying recordsAuthor
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.