when i submitted the form i get this error on my site
but i am sure of the config

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1


mysql_connect('localhost','ali_root','kingstone2012')or die (mysql_error());



if ($_POST['submit'] ){


foreach($name as $key=>$value){

$imgpath = rand().'.jpeg'; 
$insert=mysql_query("insert into  imagelocation values('','images/$imgpath'")or die (mysql_error());
$select=mysql_query("select * from imagelocation where id='$id' ");

while ($row=mysql_fetch_object($select)){
echo "<center><img src='$row->images'/></center><br/>";


<form action='' method='post' enctype='multipart/form-data'>
<input type='file' name='file[]' multiple />
<input type='submit' name='submit'/>