<?php
function display_content($link,$from=0)
{
$sql="select * from bkc_table order by date desc limit $from,10";
$result=mysql_query($sql,$link);
if(!$result){
echo mysql_errno($link).":".mysql_error($link);
}
$msgnum=mysql_num_rows($result);
for($i=0;$i<$msgnum;$i++){
$row=mysql_fetch_array($result,$link);
?>
<tr <? if($i%2==0) echo 'bgcolor="#CCCCCC"' ; else echo 'bgcolor="#99CCFF"';?>><td width=20%><?
echo"<img src=images/$row[phopo].JPG>";
echo"<td width=80% bgcolor=#CCCCCC >貨物種類:$row[species]
貨物主用料:$row[material]
貨物主顏色:$row[color]
貨物長闊高:$row[size]
價錢:$row[sellmoney] </td>";
echo"</tr>";}}
?>
who can help me??
1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '10' at line 1
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\bdb_func.php on line 9
function display_content($link,$from=0)
{
$sql="select * from bkc_table order by date desc limit $from,10";
$result=mysql_query($sql,$link);
if(!$result){
echo mysql_errno($link).":".mysql_error($link);
}
$msgnum=mysql_num_rows($result);
for($i=0;$i<$msgnum;$i++){
$row=mysql_fetch_array($result,$link);
?>
<tr <? if($i%2==0) echo 'bgcolor="#CCCCCC"' ; else echo 'bgcolor="#99CCFF"';?>><td width=20%><?
echo"<img src=images/$row[phopo].JPG>";
echo"<td width=80% bgcolor=#CCCCCC >貨物種類:$row[species]
貨物主用料:$row[material]
貨物主顏色:$row[color]
貨物長闊高:$row[size]
價錢:$row[sellmoney] </td>";
echo"</tr>";}}
?>
who can help me??
1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '10' at line 1
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\bdb_func.php on line 9