Jump to content

[SOLVED] Need Help with PHP MYSQL Insert.


sean14592

Recommended Posts

Hi.

 

Ok, well Im getting this 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 'desc) VALUES ('NULL','hi','yes','5','whc493ad286a3f2f.jpg','whc493ad286a4039.jpg' at line 1

 

My code is this:


//upload image
$newname = uniqid("whc").".jpg";
move_uploaded_file($_FILES['image_thum']['tmp_name'],
"../images/templates/$newname");

//upload image
$newname2 = uniqid("whc").".jpg";
move_uploaded_file($_FILES['full_image']['tmp_name'],
"../images/templates/$newname2");


mysql_connect(*********,*********,*********) or die(mysql_error());
mysql_select_db(*********) or die(mysql_error());

$name = $_POST['name'];
$members = $_POST['members'];
$cat = $_POST['cat'];
$desc = $_POST['desc_main'];

// Insert a row of information into the table
mysql_query(" INSERT INTO templates (id, name, members, cat, image_thum, full_image, desc) VALUES ('NULL','$name','$members','$cat','$newname','$newname2','$desc') ") or die(mysql_error());




echo "complete";

 

 

Cheers

Sean

Link to comment
https://forums.phpfreaks.com/topic/135827-solved-need-help-with-php-mysql-insert/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.