Jump to content

Recommended Posts

Hi all,

 

Having a little problem with my mysql insert in PHP, not sure which forum to have it in.

 

Here's the code:

 

        // Insert the copied lot into the unassigned lots listings
        $put_CopiedLot = "INSERT INTO jos_bid_auctions ";
        $put_CopiedLot .= "(userid, title, shortdescription, ";
        $put_CopiedLot .= "description, picture, initial_price, ";
        $put_CopiedLot .= "automatic, shipment_info, reserve_price, ";
        $put_CopiedLot .= "cat, vat_rate, est_low, est_high, ";
        $put_CopiedLot .= "outside_eu, condition, receipt_num, ";
        $put_CopiedLot .= "lot_num, keywords, maker, ";
        $put_CopiedLot .= "age, rec_num, line_num, ";
        $put_CopiedLot .= "con_rec_num, lot_order) ";
        $put_CopiedLot .= "VALUES (";
        $put_CopiedLot .= "'".$userid."', '".$title."', '".$shortdesc."', ";
        $put_CopiedLot .= "'".$description."', '".$picture."', '".$initial_price."', ";
        $put_CopiedLot .= "'".$automatic."', '".$shipment_info."', '".$reserve_price."', ";
        $put_CopiedLot .= "'1', '".$vat_rate."', '".$est_low."', '".$est_high."', ";
        $put_CopiedLot .= "'".$outside_eu."', '".$condition."', '".$receipt_num."', ";
        $put_CopiedLot .= "'".$lot_num."', '".$keywords."', '".$maker."', ";
        $put_CopiedLot .= "'".$age."', '".$rec_num."', '".$line_num."', ";
        $put_CopiedLot .= "'".$con_rec_num."', '".$lot_order."') ";
        echo $put_CopiedLot;
        $rCopiedLot = mysql_query($put_CopiedLot) or die(mysql_errno() . mysql_error());

 

I can't see anything wrong with it, but it reports an error:

 

"1064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition, receipt_num, lot_num, keywords, maker, age, rec_num, line_num, con_re' at line 1"

 

Now I've figured out from previous errors like this that it's usually just before the part of the query that's actually quoted...  But I can't see anything wrong with the code.  I kept the names the same for ease of use here, and the spelling is OK...  It was all cut and pasted so if there are any errors it should be right at the start, but nooooo.....

 

Mysql Ver: 5.0.51a-community-nt running on Wamp Server 2

 

Maybe I haven't had enough coffee  :D or too much  :-\

Link to comment
https://forums.phpfreaks.com/topic/139983-solved-am-i-missing-something/
Share on other sites

Okay - tho I just copied the error bit.

 

INSERT INTO jos_bid_auctions (userid, title, shortdescription, description, picture, initial_price, automatic, shipment_info, reserve_price, cat, vat_rate, est_low, est_high, outside_eu, condition, receipt_num, lot_num, keywords, maker, age, rec_num, line_num, con_rec_num, lot_order) VALUES ('7807', 'A Guitar by Louis Panormo, London 1837', 'A Guitar by Louis Panormo, London 1837', 'A Guitar by Louis Panormo, London 1837 Labelled: Louis Panormo the only maker of guitars in the Spanish style...Bloomsbury...London 1837 The back and ribs of rosewood, the table of medium grain spruce, the sound hole set with concentric circles inlaid with mother of pearl lozenges, the bone rollers, the brass machines by Rance, the mother of pearl tuners, the head stock stamped: Pratten, and bearing the seal of Sydney Pratten, a stylised monograph in red wax', '1005/1_Lot-108f.jpg', '1', '0', '', '0', '1', '', '1200', '1800', '', 'Good', '0', '108', 'guitar', '', '', '3218', '1', '0', '2')

 

1064 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 'condition, receipt_num, lot_num, keywords, maker, age, rec_num, line_num, con_re' at line 1

 

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.