PDA

View Full Version : حرفه ای: چرا این کدم خطا میده ؟



reza10wert
یک شنبه 29 بهمن 1391, 18:07 عصر
سلام
من این کد را وقتی صفحه اجرا میشه خطا میده
خط آخر خط شماره 163 هست


connecttodb();
$count_record = mysql_num_rows(mysql_query("SELECT * FROM `tbl_news`")); // Count of all records
$inpage = 3 ; // Count of records to show in page
$count_page = ceil($count_record/$inpage); // Count pages
$query_news = mysql_query("SELECT * FROM `tbl_news` ORDER BY `id` DESC LIMIT ($page-1) , $inpage");
while ( $row_news = mysql_fetch_array ( $query_news ) ) {



خطا

( ! ) Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\Karino\news.php on line 163

siavashsay
یک شنبه 29 بهمن 1391, 19:01 عصر
میشه بگید متغیر page در این کد ($page-1) کجا تعریف شده ؟!

Tarragon
یک شنبه 29 بهمن 1391, 19:04 عصر
$page تعریف شده؟


if(mysql_errno != 0)die(mysql_error());

رو قبل از خط 163 جایگزین کنید ببینید چی میشه؟