From:             peymanium1 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:
------------
 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=37491&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37491&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37491&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37491&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37491&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37491&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37491&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37491&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37491&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37491&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37491&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37491&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37491&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37491&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37491&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37491&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37491&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37491&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37491&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37491&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37491&r=mysqlcfg

Reply via email to