note 34581 added to function.odbc-exec

From: Date: Thu, 31 Jul 2003 11:49:34 +0000
Subject: note 34581 added to function.odbc-exec
Groups: php.notes 
Request: Send a blank email to php-notes+get-53067@lists.php.net to get a copy of this message
Hi there! i have a file called delete_lector.php: <? if(!IsSet($HTTP_POST_VARS[Delete_Lector_Hidden])) {echo "You are not an administrator";die();} include("../connections/db.inc"); $dbh=odbc_connect ($host, $un, $pw) or die ('I cannot connect to the database'); $query="Select Nume_Lector,Prenume_Lector from Lector where ID_Lector="; $query.=$HTTP_POST_VARS[Lector]; $result=odbc_exec($dbh,$query); $var1=odbc_result($result,1); $var2=odbc_result($result,2); odbc_free_result($result); $query1="delete from Lector where ID_LEctor="; $query1.=$HTTP_POST_VARS[Lector]; $result1=odbc_exec($dbh,$query1); echo "lectorul "; echo $var1," ",$var2; echo " a fost eliminat"; ?> but there appears an error: Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '='., SQL state 37000 in SQLExecDirect in D:\Project\USM DESIGN\do\do_rom\stud\administrator\delete_lector.php on line 12 $result=odbc_exec($dbh,$query); what is my mistake??? ---- Manual Page -- http://www.php.net/manual/en/function.odbc-exec.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34581 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34581&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34581&report=yes

« previous php.notes (#53067) next »