Jump to content

INSERTION QUERY --- GIVING PROBLEMS


tapius1

Recommended Posts

I need some help figuring out what's wrong with my query

.....//create new db object that connects to the db
      $db = new DB2();
       if(!$db->connect("DB2CONN", "user","*******"))
       {
       print "Error\n";
       header("location:ERROR.htm");
      }
        //insert statement to repleace account information with updated information, make sure all fields are filled in,
        //if possible use _GET and put in the values into the boxes before the user makes any changes
       $sql .="INSERT INTO KCWEB
        (ADDR1, ADDR2, CITY, STATE, ZIP, PHONE1, PHONE2, SSN_NUM)
        VALUES ($address1, $address2, $city, $state, $zip, $phone1, $phone2, $ssn_num) 
        WHERE CTRL_NUM = $ctrl_num";
        $db->query($sql);
        echo "Account Information Updated";
?>

 

it returns :

Error: [unixODBC][iBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token , was not valid. Valid tokens: ( + - ? : DAY RRN CASE CAST CHAR DATE DAYS HASH HOUR LEFT NULL.

SQL: INSERT INTO KCWEB (ADDR1, ADDR2, CITY, STATE, ZIP, PHONE1, PHONE2, SSN_NUM) VALUES (, , , , , , , 3333) WHERE CTRL_NUM = 3333333333

 

any help would be great thanks

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.