Re: [PHP-DB] MSSQL INSERT query problem

2004-08-05 Thread John Holmes
Chris wrote: Here is the code I use: [snip] $sql =& $db->prepare("INSERT INTO ExitSurveyAnswers (session_id, Question_id, answer) VALUES ?,?,?"); [snip] When I execute it I keep recieving and error message stating: DB Error: syntax error Not a MSSQL expert, but shouldn't the ?,?,? in your query hav

[PHP-DB] MSSQL INSERT query problem

2004-08-05 Thread Chris
Here is the code I use: $dsn = "mssql://username:[EMAIL PROTECTED]/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("

Re: [PHP-DB] mssql insert

2004-03-28 Thread Miles Thompson
>$query = "INSERT INTO myTable VALUES ('".$myVar."');'; Check the commas? Miles At 05:50 PM 3/28/2004 +1200, Martin Ryan wrote: Got a dumb-ass question for you all. I have got insert queries working with mssql_query($query); except if any of the variables have two or more words. For example: $myVa

[PHP-DB] mssql insert

2004-03-27 Thread Martin Ryan
Got a dumb-ass question for you all. I have got insert queries working with mssql_query($query); except if any of the variables have two or more words. For example: $myVar = "Two or more words"; $query = "INSERT INTO myTable VALUES ('".$myVar."');'; mssql_query($query,$db); The query will only in

[PHP-DB] mssql: insert a record and return the auto increment ID

2002-09-02 Thread Heiko Mundle
I insert a new record with PHP into my MS SQL Server database. The key is defined with auto_idINT IDENTITY(1000,1) NOT NULL, how do I get the new id to use it in PHP? To insert the record I use this code: $sSql = "INSERT INTO myTable (time_in ) VALUES ( getdat