1st user has to fill this form
<form action="upload.php" method='post' enctype = 'multipart/form-data'>
ImageName: <input class = "text" type="text" name="imagename" /><br/>
Description<textarea name="imagedes"cols="16" rows="4"> </textarea><br/>
<input type ="file" name="fileupload" /><br/>
<input type="submit" name="submit" value="sumbit" /><br/>
<a href="index.php">[BACK]</a>
</form>
than it run php code. here i am getting image infomation
$image_short_name = $_POST['imagename']; //get image title from form
$image_des = $_POST['imagedes']; //get description of image
$image = file_get_contents($_FILES['fileupload']['tmp_name']); //get image
$image_full_name = $_FILES['fileupload']['name']; //get image realler name
$image_size = getimagesize($_FILES['fileupload']['tmp_name']); //get image size
//get user_id from table called user
$queryget = mysql_query("SELECT user_id FROM user WHERE username = '$user'") or die("query didnt work");
$row = mysql_fetch_assoc($queryget);
$user_id_db = $row['user_id'];
now i have all the infomation. i just want to store in database. my database is called image and it has folling:
image_id
user_id
image
image_full_name
image_short_name
image_des
image_view
image_fav
//insert information into database
if(!$insert = mysql_query("INSERT INTO image VALUES(NULL, 'user_id_db', '$image', '$image_full_name', '$image_short_name', 'image_des')"))
{
echo "problem uploading image";
}
else
{
works
}
it always print "priblem uploading image". so the probblem is in mysql_query()