note 41027 added to function.mysql-affected-rows

From: Date: Sat, 27 Mar 2004 08:14:16 +0000
Subject: note 41027 added to function.mysql-affected-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-67224@lists.php.net to get a copy of this message
i have a problem when want to DELETE data from MYSQL through PHP. <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <? $HTTP_POST_VARS["title"]=addslashes($HTTP_POST_VARS["title"]); @ $HTTP_POST_VARS["db"]=mysql_pconnect ("localhost"); if (!$HTTP_POST_VARS["db"]) { echo "Error : Could not connect to database.Plz try again later."; exit; } mysql_select_db ("books"); $HTTP_POST_VARS["query"]="delete from books where title = $HTTP_POST_VARS["title"]"; $HTTP_POST_VARS["result"]=mysql_query($HTTP_POST_VARS["query"]); if ($HTTP_POST_VARS["result"]) echo mysql_affected_rows()." book delete into database."; ?> </body> </html> when I run it the warnig occured. Parse error: parse error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in c:\program files\apache group\apache\htdocs\book-o-rama\delete_book.php on line 22 line 22 is actually $HTTP_POST_VARS["query"]="delete from books where title = $HTTP_POST_VARS["title"]"; can you help me.Thank. ---- Manual Page -- http://www.php.net/manual/en/function.mysql-affected-rows.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41027 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41027&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41027&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67224) next »