msafvati Posted December 14, 2007 Share Posted December 14, 2007 hi i have error when i want to insert data to Database(ms-Access) please guide me!! warning is : insert into TblDarman values(ihpbpihb,'','','','') Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect in F:\Project site Expert\Darman\ToseeDarman1.php on line 23 Source is: <?php if(!strlen(trim($_GET['txt1']))) { echo "123"; die(); } $connectionstring = odbc_connect("Darman", "",""); $query ="insert into TblDarman values("; $query = $query.$_GET['txt1'].","; $query = $query."'".$_GET['txt2']."',"; $query = $query."'".$_GET['txt3']."',"; $query = $query."'".$_GET['txt4']."',"; $query = $query."'".$_GET['txt5']."')"; echo $query; $result = odbc_do($connectionstring, $query); odbc_close($connectionstring); ?> thank u! Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 14, 2007 Share Posted December 14, 2007 your amount of fields(values) do not match that of the table try insert into table (fieldname1,fieldname2..) values (value1,value2..) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.