Jump to content

Recommended Posts

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!  :shrug:

 

 

$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')");

 

 

Link to comment
https://forums.phpfreaks.com/topic/210024-cant-insert-row-from-php/
Share on other sites

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.