note 53394 added to function.odbc-do

From: Date: Tue, 31 May 2005 14:10:30 +0000
Subject: note 53394 added to function.odbc-do
Groups: php.notes 
Request: Send a blank email to php-notes+get-89679@lists.php.net to get a copy of this message
Some of you may be having problems with Access SQL. I got "Too few parameters" many times before I figured this out. MS Access does not like double quotes in a SQL string like this: <?php $sql = 'INSERT INTO table (field1,field2,field3,field4) VALUES ("text value 1", "text 2",3,"text 4")'; ?> This resulted in an obscure error: Too few parameters. So - The following should work much better: <?php $sql = "INSERT INTO table (field1,field2,field3,field4) VALUES ('text value 1', 'text 2',3,'text 4')"; ?> ---- Manual Page -- http://www.php.net/manual/en/function.odbc-do.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+53394 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53394&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53394&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53394&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53394&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53394&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+53394&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#89679) next »