I need it to be uploaded to the database. Do you know how to fix it ? Because when I uploaded image show it error massageI need it to be uploaded to the database. Do you know how to fix it ? Because when I uploaded image show it error massage
$title = $_POST['title'];
$info = $_POST['info'];
$text = $_POST['text'];
// varabls Uploud
$imgssName = $_FILES['img']['name'];
$imgSize = $_FILES['img']['size'];
$imgTmp = $_FILES['img']['tmp_name'];
$imgType = $_FILES['img']['type'];
// Chek extensions Img
$file_parts = pathinfo($imgssName);
$file_parts['extension'];
$cool_extensions = Array('jpeg', 'jpg', 'JPG', 'png', 'PNG', 'gif', 'JPEG', 'GIF', 'pdf','psd');
if (in_array($file_parts['extension'], $cool_extensions)){
// Chek Size Img
$img = rand(0, 100000000) . '_' . $imgssName;
move_uploaded_file($imgTmp, "uploads/imgs//" . $img);
$stmt = $con->prepare("INSERT INTO
news(title,info,text,img,date) VALUES (:btitle, :binfo, :btext, :bimg, now() )");
$stmt->execute(array(
'btitle' => $title,
'binfo' => $info,
'btext' => $text,
'bimg' => $img,
));
?