MSSQL INSERT query problem

From: Date: Thu, 05 Aug 2004 22:07:47 +0000
Subject: MSSQL INSERT query problem
Groups: php.db 
Request: Send a blank email to php-db+get-35598@lists.php.net to get a copy of this message
Here is the code I use: $dsn = "mssql://username:password@location.com/database"; $options = array( 'debug' => 2, 'portability' => DB_PORTABILITY_ALL, ); $db =& DB::connect($dsn, $options); if (DB::isError($db)) { $db->getDebugInfo(); die($db->getMessage()); } $sql =& $db->prepare("INSERT INTO ExitSurveyAnswers (session_id, Question_id, answer) VALUES ?,?,?"); // Always check that result is not an error if (DB::isError($sql)) { $sql->getDebugInfo(); die($sql->getMessage()); } $alldata = array($id,$question,$answer); $res =& $db->execute($sql, $alldata); print_r ($res); if (DB::isError($res)) { $res->getDebugInfo(); die($res->getMessage()); } $db->disconnect(); When I execute it I keep recieving and error message stating: DB Error: syntax error I use PEAR DB and PEAR HTTP SESSION. Any ideas will be helpful. Thanks, Chris

« previous php.db (#35598) next »