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
Share on other sites

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.