|
您好我有買你的書 可是您裡面附的程式 無法正常連mysql 因為你裡面都是用 <?php header("Content-Type: text/html; charset=utf-8"); include("connsql.php"); //含入連結資料庫檔案
$sql_query = "SELECT `orderid`,`phone`,`name` FROM `orders` WHERE `finish`=0 ORDER BY `orderid` DESC"; $result = mysql_query($sql_query); $numrow = mysql_num_rows($result); $row_result = array(); $i = 0; while($row_result[$i] = mysql_fetch_array($result, MYSQL_ASSOC)){ $i++; }
但是會出現以下錯誤:
Warning: Cannot modify header information - headers already sent by (output started at /home/merciful/public_html/orderdrink/index0.php:2) in /home/merciful/public_html/orderdrink/index0.php on line 3 Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in /home/merciful/public_html/orderdrink/index0.php on line 8
Warning: mysql_query(): A link to the server could not be established in /home/merciful/public_html/orderdrink/index0.php on line 8
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/merciful/public_html/orderdrink/index0.php on line 9
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/merciful/public_html/orderdrink/index0.php on line 12
請問老師我要怎麼修改呢 我已經查多網路資料了 都無法解決 |