What is the error in deleting this delete? & Lt; table & gt; & lt; tr & gt; & nbsp; & lt; td & gt; & nbsp; & lt; td & gt; & lt; pstyle & quot; font-size: 13px; font-weight: bold; & quot; & gt; PaperTitle & lt; p & gt; & lt; what is the error in deleting this delete?
|
Paper Title |
Comments |
Upload Date |
Delete |
$ Con = @ mysql_connect ("localhost", "root", "") or die ("failed to connect the database ");Mysql_select_db ("iccp", $ con );Mysql_query ("set names 'gbk '");$ SQL = "select * from t_paper where contributor_id = 118 ";$ Query = mysql_query ($ SQL );While ($ row = mysql_fetch_array ($ query )){?>
|
|
|
|
|
}
If (! Empty ($ _ POST ['name']) {
$ Str = explode (",", $ _ POST ['name']);
Mysql_query ("delete from t_paper where paper_title in ($ str )");}
?>
Why can't I get the value of $ _ POST ['name ']?
------ Solution --------------------
No form
------ Solution --------------------
In addition, isset () should be used to determine whether a form is submitted ()
PHP code
If (isset ($ _ POST ['name']) {$ str = explode (",", $ _ POST ['name']); mysql_query ("delete from t_paper where paper_title in ($ str)"); // There is a clear problem here. The explode () function returns an array and the SQL statement syntax is incorrect}