1
I've run into a dead end for a module I'm developing and could use another pair of eyes (or a few pair) to help me find what must be an obvious answer.
The code is as follows:
le="color: #000000"><?php $sql = "INSERT INTO ".$xoopsDB->prefix('draft_order')." (draftid, roundnumber, picknumber, userid) VALUES ($draftid, $round, $claimedpick, $uid)"; if ( !$result = $xoopsDB->query($sql) ) { // redirect_header(XOOPS_URL.'/',1,_MD_ERROROCCURED); echo "Error: $sql<br>"; echo $xoopsDB->error." : ".$xoopsDB->errno; exit(); }
The two echo lines produce the following output:
le="color: #000000"><?php Error: INSERT INTO mockxoops_draft_order (draftid, roundnumber, picknumber, userid) VALUES (3, 1, 1, 1) :
If I copy the sql statement straight into phpMyAdmin, the insert works without a problem and that's where my frustration lies. Obviously the statement is ok, so where else can the error be? I was hoping that using $xoopsDB->error and errno would provide some insight, but I must be calling them incorrectly.