Hey guys, There is a problem with my insert function in php... $vid_title = $_POST['vid_title']; $vid_desc = $_POST['vid_description']; $vid_cat = $_POST['vid_cat']; $vid_usr_ip = $_SERVER['REMOTE_ADDR']; $vid_file = $_FILES['vid_file']; $query = "INSERT INTO videos (Username, Title, Description, Category, PageURL, FilePath, Thumbnail, Rating, Views, IPAddress) VALUES ('".$details[0]."', '".$_POST['vid_title']."', '".$_POST['vid_description']."', '".$_POST['vid_cat']."', '../../videos/'".time()."'/', 'videos/'".time()."'/video.flv, 'videos/'".time()."'/'".$_FILES['vid_file']."', '', '', '".$vid_usr_ip."')"; mysql_query($query); The site says its a synax error... What do I need to do????? I already connected to my DB and all, whats wrong? Also don't mind the "$details[0]; function, that isn't the problem... Thanks in advance, Majo0od
this is the error: 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 '1256759783'/', 'videos/'1256759783'/video.flv, 'videos/'1256759783'/'Array', '',' at line 1 how is that possible? I did this type of code before...
You should remove double quotes and dots from you query string, you dont need them. $query = "INSERT INTO videos (Username, Title, Description, Category, PageURL, FilePath, Thumbnail, Rating, Views, IPAddress) VALUES ('$details[0]', '$_POST['vid_title']', '$_POST['vid_description']', '$_POST['vid_cat']', '../../videos/'time()'/', 'videos/'time().'/video.flv, 'videos/'time()'/'$_FILES['vid_file']', '', '', '$vid_usr_ip')";
still didn't work..... error: 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 'time()'/', 'videos/'time()'/video.flv, 'videos/'time()'/'Array', '', '', '69.41.' at line 1
dont use 'time()' if its already in quotes use something like this 'videos/".time()."/'".$_FILES['vid_file']."' remove single quotes surrounding time()