msafvati Posted February 19, 2008 Share Posted February 19, 2008 hi i have a problem!!! when i insert Data To DB PHP Compiler Show me a warning. please guide me for this warning Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in E:\MAS\Prj2\Local path\MASRegCod\MASReg.php on line 119 Script is : <?php $connectionstring = odbc_connect("User", "", ""); $query ="insert into tblReguser values("; $query = $query."'".$_GET['txt1']."',"; $query = $query."'".$_GET['txt2']."',"; $query = $query."'".$_GET['txt3']."',"; $query = $query."'".$_GET['txt4']."',"; $query = $query."'".$_GET['txt5']."',"; $query = $query."'".$_GET['txt6']."',"; $query = $query."'".$_GET['txt7']."',"; $query = $query."'".$_GET['txt8']."',"; $query = $query."'".$_GET['txt9']."',"; $query = $query."'".$_GET['txt10']."',"; $query = $query."'".$_GET['txt11']."',"; $query = $query."'".$_GET['txt12']."',"; $query = $query."'".$_GET['txt13']."',"; $query = $query."'".$_GET['txt14']."',)"; #echo $query; $result = odbc_do($connectionstring, $query); if ($Result == 1) echo "ÔãÇ ÈÇ ãæÝÞíÊ ÏÑ ÓíÓÊã ßÇÑíÇÈí ßÔæÑí ËÈÊ ÔÏíÏ " ; odbc_close($connectionstring); ?> line 119 : $result = odbc_do($connectionstring, $query); Thank you.. Link to comment https://forums.phpfreaks.com/topic/91829-warning-in-insert-data-to-db/ Share on other sites More sharing options...
rameshfaj Posted February 19, 2008 Share Posted February 19, 2008 Did u have the same no of fields in the table as u have provided the values in the query? Try printing the query before executing it and see.Others seem to be ok. Link to comment https://forums.phpfreaks.com/topic/91829-warning-in-insert-data-to-db/#findComment-470429 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.