#37490 [NEW]: I have Error in Inserting item to my DB

From: Date: Thu, 18 May 2006 08:57:40 +0000
Subject: #37490 [NEW]: I have Error in Inserting item to my DB
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-97303@lists.php.net to get a copy of this message
From: peymaniu1 at yahoo dot com Operating system: Windows XP PHP version: 5.1.4 PHP Bug Type: ODBC related Bug description: I have Error in Inserting item to my DB Description: ------------ Hi I have problem when inserting data to my MS Access DB. It gives error I'm using odbc_exec () function. Can anyone help me please! I have to submit my project on saturday! Reproduce code: --------------- <?php $db = odbc_connect('ezLearning', 'peyman', 'attarzadeh') or die('Could Not Connect to ODBC Database!'); require_once('test2_complete.php'); $a=$_POST["username"]; $b=$_POST["password"]; $q = "INSERT INTO [t1]([username],[password]) VALUES ($a,$b);"; odbc_exec ($db,$q); odbc_close($db); ?> Expected result: ---------------- the result should be anything you entered for the values $a and $b. Actual result: -------------- Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2., SQL state 07001 in SQLExecDirect in c:\Inetpub\wwwroot\ezLearning\test2_complete.php on line 14 -- Edit bug report at http://bugs.php.net/?id=37490&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37490&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37490&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37490&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37490&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37490&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37490&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37490&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37490&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37490&r=support Expected behavior: http://bugs.php.net/fix.php?id=37490&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37490&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37490&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37490&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37490&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37490&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37490&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37490&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37490&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37490&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37490&r=mysqlcfg

« previous php.bugs (#97303) next »