i want to upload an image to php database, my php code
<?php
session_start();
include('../../includes/connect.php');
$title = $_POST['title'];
$subject = $_POST['subject'];
$file = $_FILES['image']['tmp_name'];
$image = addslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_size = getimagesize($_FILES['image']['tmp_name']);
$visiable = 1;
$query = "insert into news (title, subject, image, visiable) values ('$title','$subject', '$image', '$visiable')";
$result = mysql_query($query);
$id = mysql_insert_id();
$data = array(
'id' => $id
);
$base = '../../show.php';
$url = $base. '?' . http_build_query($data);
header("Location: $url");
exit();?>
but it upload nothing the image field is still 0 byte, it works me yesterday but today i dont know what happened, I hop that someone can help me, sorry for my bad english