Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem code 1

Status
Not open for further replies.

BigDoug

IS-IT--Management
Feb 20, 2002
49
US
Someone please help! I don't want someone to do my work for me, but I cannot figure out where I have gone wrong with this code. I think it is just a formatting issue, but I just don't know. The syntax shows as correct, but it still does not work right. Anybody want to help me figure out my faux paus?? Any help is gonna be much appreciated. Here is the code:

$db->do("INSERT INTO Items (category,type,title,seller,start,reserve,increment,quantity,open,close,description,image1,closef,bold,yellow,featured,grabber,catfeat,galfeat,pay1,pay2,pay3,pay4,pay5,pay6,pay7,pay8,pay9,location,shippay,counter,visits,shiploc,image2,image3,image4,image5,repost,repostdays,buyitprice,region,icountry) VALUES ('" . UltimateAuction::sql_encode($one) . "','" . UltimateAuction::sql_encode($type) . "','" . UltimateAuction::sql_encode($three) . "','" . int($usernum) . "','" . UltimateAuction::dollar_encode($five) . "','" . UltimateAuction::dollar_encode($six) . "','" . UltimateAuction::dollar_encode($seven) . "','" . int($eight) . ",$ct,$current_time+(" . int($thirtythree) . "*86400),'" . UltimateAuction::sql_encode($eleven) . "','" . UltimateAuction::sql_encode($twelve) . "',0,'" . UltimateAuction::sql_encode($fourteen) . "','" . UltimateAuction::sql_encode($fifteen) . "','" . UltimateAuction::sql_encode($sixteen) . "','" . UltimateAuction::sql_encode($seventeen) . "','" . UltimateAuction::sql_encode($eighteen) . "','" . UltimateAuction::sql_encode($nineteen) . "','" . UltimateAuction::sql_encode($twenty) . "','" . UltimateAuction::sql_encode($twentyone) . "','" . UltimateAuction::sql_encode($twentytwo) . "','" . UltimateAuction::sql_encode($twentythree) . "','" . UltimateAuction::sql_encode($twentyfour) . "','" . UltimateAuction::sql_encode($twentyfive) . "','" . UltimateAuction::sql_encode($twentysix) . "','" . UltimateAuction::sql_encode($twentyseven) . "','" . UltimateAuction::sql_encode($twentyeight) . "','" . UltimateAuction::sql_encode($twentynine) . "','" . UltimateAuction::sql_encode($thirty) . "','" . UltimateAuction::sql_encode($thirtyone) . "','" . "','" . int(0) . "','" . UltimateAuction::sql_encode($thirtythree) . "','" . UltimateAuction::sql_encode($thirtyfour) . "','" . UltimateAuction::sql_encode($thirtyfive) . "','" . UltimateAuction::sql_encode($thirtysix) . "','" . UltimateAuction::sql_encode($thirtyseven) . "','" . int(0) . "','" . int($thirtyeight) . "','" . UltimateAuction::dollar_encode($thirtynine) . "','" . UltimateAuction::sql_encode($fourty) . "','" . UltimateAuction::sql_encode($fourtyone) . "','" . UltimateAuction::sql_encode($fourtytwo) . "')");
 
ok try this:

$db->do("INSERT INTO Items (category,type,title,seller,start,reserve,increment," .
"quantity,open,close,description,image1,closef,bold,yellow,featured,grabber," .
"catfeat,galfeat,pay1,pay2,pay3,pay4,pay5,pay6,pay7,pay8,pay9,location," .
"shippay,counter,visits,shiploc,image2,image3,image4,image5,repost," .
"repostdays,buyitprice,region,icountry) VALUES " .
"('" . UltimateAuction::sql_encode($one) . "','" . UltimateAuction::sql_encode($type) .
"', '" . UltimateAuction::sql_encode($three) . "','" . int($usernum) . "','" .
UltimateAuction::dollar_encode($five) . "','" . UltimateAuction::dollar_encode($six) .
"','" . UltimateAuction::dollar_encode($seven) . "','" . int($eight) .
"',$ct, '" . $current_time+(int($thirtythree)*86400),
UltimateAuction::sql_encode($eleven) . "','" . UltimateAuction::sql_encode($twelve) .
"',0,'" . UltimateAuction::sql_encode($fourteen) . "','" .
UltimateAuction::sql_encode($fifteen) . "','" . UltimateAuction::sql_encode($sixteen) .
"','" . UltimateAuction::sql_encode($seventeen) . "','" . UltimateAuction::sql_encode($eighteen) .
"','" . UltimateAuction::sql_encode($nineteen) . "','" . UltimateAuction::sql_encode($twenty) .
"','" . UltimateAuction::sql_encode($twentyone) . "','" . UltimateAuction::sql_encode($twentytwo) .
"','" . UltimateAuction::sql_encode($twentythree) . "','" . UltimateAuction::sql_encode($twentyfour) .
"','" . UltimateAuction::sql_encode($twentyfive) . "','" . UltimateAuction::sql_encode($twentysix) .
"','" . UltimateAuction::sql_encode($twentyseven) . "','" . UltimateAuction::sql_encode($twentyeight) .
"','" . UltimateAuction::sql_encode($twentynine) . "','" . UltimateAuction::sql_encode($thirty) .
"','" . UltimateAuction::sql_encode($thirtyone) . "','" . "','" . int(0) . "','" .
UltimateAuction::sql_encode($thirtythree) . "','" . UltimateAuction::sql_encode($thirtyfour) .
"','" . UltimateAuction::sql_encode($thirtyfive) . "','" . UltimateAuction::sql_encode($thirtysix) .
"','" . UltimateAuction::sql_encode($thirtyseven) . "','" . int(0) . "','" . int($thirtyeight) . "','" .
UltimateAuction::dollar_encode($thirtynine) . "','" . UltimateAuction::sql_encode($fourty) . "','" .
UltimateAuction::sql_encode($fourtyone) . "','" . UltimateAuction::sql_encode($fourtytwo) . "')");

 
Nope, I get the same problem. It just won't write the data into the database. I could post the original code that does work but lacked functionality, that is why I tweaked this one. The original works fine, but the new one I did won't write the data into the MySQL database. Quite the hair pulling couple of days on this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top