|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-18 09:11 UTC] bjori@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 16:00:01 2025 UTC |
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