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
https://forums.phpfreaks.com/topic/166829-insertion-query-giving-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.