Jump to content

warning In Insert data to DB


msafvati

Recommended Posts

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!

 

Link to comment
https://forums.phpfreaks.com/topic/81647-warning-in-insert-data-to-db/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.