請問PHP 5.3 mysql_query()語法..謝謝.

大家好.. 個人有支程式..原本運作都很正常.. 但因安裝軟體需要新版php(現為PHP Version 5.3.10)..就無法運作了.. 錯誤訊息及程式如下..網上找了幾天..都不知要如何排除.. 煩請各位大大幫忙看看新版語法要如何修正..謝謝啦.. php file_delete.php PHP Warning: mysql_query() expects parameter 2 to be resource, string given in file_delete.php on line 5 PHP Warning: mysql_num_rows() expects parameter 1 to... 顯示更多 大家好..
個人有支程式..原本運作都很正常..
但因安裝軟體需要新版php(現為PHP Version 5.3.10)..就無法運作了..
錯誤訊息及程式如下..網上找了幾天..都不知要如何排除..
煩請各位大大幫忙看看新版語法要如何修正..謝謝啦..
php file_delete.php
PHP Warning: mysql_query() expects parameter 2 to be resource, string given in file_delete.php on line 5
PHP Warning: mysql_num_rows() expects parameter 1 to be resource, null given in file_delete.php on line 6

config.php
<?
$db_host = "localhost";
$db_user = "xxxx";
$db_pass = "xxxx";
$db_name = "upload_file";
$db_orin = "file_list";
$link = MYSQL_CONNECT($db_host, $db_user, $db_pass) OR DIE("Unable to connect to database");
$db_use = mysql_select_db($db_name,$link) or DIE("Unable to use database");
?>

file_delete.php
<?
include ("config.php");
$today = date("Ymd");
$str="select * from file_list where fl06='N'";
$search = mysql_query($db_name,$str);
$number = mysql_num_rows($search);
for ($i=0;$i<$number;$i++)
{
$result = mysql_fetch_array($search);
$temp_id=$result['fl_id'];
$temp_flie=$result['fl01'];
$temp_no=$result['fl03'];
if ($temp_no <> 0)
{
$str1="update file_list set fl03=($temp_no-1) where fl_id=$temp_id";
mysql_query($db_name,$str1);
}
else
{
$str1="update file_list set fl04='$today', fl06='Y' where fl_id=$temp_id ";
mysql_query($db_name,$str1);
unlink("$temp_flie");
}
}
?>
更新: 非常感謝..更改過後..已能正常作業了..感恩啦..
1 個解答 1