下面是一個顯示在MySQL查詢一些錯誤我的代碼:如何比較輸入數組與MySQL列?
<?php
$con=mysql_connect('localhost','root','');
$str=$_GET["message"];
$stor=explode(" ",$str);// converting message into array
mysql_select_db('words',$con);
for($j=0;$j<=30; $j++)
{
mysql_query($con,"UPDATE blacklist SET $stor=1 where $stor=0");//if column name=element in array then make it as 1 in database
}
mysql_close($con);
?>
什麼是錯誤? – jcho360 2013-03-15 15:44:36
mysql_query的常用用法是'mysql_query(「Query」,$ Con);' – 2013-03-15 15:45:09
不使用mysql_ *([已棄用](http://php.net/manual/en/function.mysql-query)。 PHP)),使用[PDO](http://www.php.net/manual/en/ref.pdo-mysql.php)而不是 – DonCallisto 2013-03-15 15:45:11