AtomicRax Posted August 7, 2010 Share Posted August 7, 2010 This is about to drive me insane! I've double checked all of my variables, they're all assigned OK and everything (each variable has the correct value)...but for some reason, this code will NOT insert a new row! $file1 = "/path/to/picture.jpg"; $file2 = "/path/to/picture.gif"; $file3 = "/path/to/picture.png"; $thumb = "/path/to/tn_picture.jpg"; $date = date('m/d/Y'); $enddate = date('m/d/Y', strtotime("+30 days")); $uid = $mySite->user['uid']; $user = $mySite->user['username']; $time = time(); $category = $_POST[category]; $parish = $_POST[parish]; $title = $_POST[title]; $description = strip_tags($_POST[description]); $description = substr($description, 0, 2000); mysql_query("INSERT INTO ads_entries (`adID`, `uid`, `username`, `date`, `timestamp`, `enddate`, `category`, `parish`, `title`, `description`, `pictureA`, `pictureB`, `pictureC`, `tnPicture`) VALUES ('', '$uid', '$user', '$date', '$time', '$enddate', '$category', '$parish', '$title', '$description', '$file1', '$file2', '$file3', '$thumb')"); Quote Link to comment https://forums.phpfreaks.com/topic/210024-cant-insert-row-from-php/ Share on other sites More sharing options...
AtomicRax Posted August 7, 2010 Author Share Posted August 7, 2010 For some reason it needed to be: mysql_query("INSERT INTO ads_entries (`adID`, `uid`, `username`, `date`, `timestamp`, `enddate`, `category`, `parish`, `title`, `description`, `pictureA`, `pictureB`, `pictureC`, `tnPicture`) VALUES (\"\", \"$uid\", \"$user\", \"$date\", \"$time\", \"$enddate\", \"$category\", \"$parish\", \"$title\", \"$description\", \"$file1\", \"$file2\", \"$file3\", \"$thumb\")"); Either way, I got it now. Quote Link to comment https://forums.phpfreaks.com/topic/210024-cant-insert-row-from-php/#findComment-1096164 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.