Skip navigation links

MySQL Forums :: PHP :: 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


Advanced Search

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
Posted by: siu chan ()
Date: September 20, 2011 05:54AM

<?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]&nbsp;&nbsp;&nbsp;
貨物主用料:$row[material]&nbsp;&nbsp;&nbsp;
貨物主顏色:$row&nbsp;&nbsp;&nbsp;
貨物長闊高:$row&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
價錢:$row[sellmoney]&nbsp;&nbsp;&nbsp;</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

Options: ReplyQuote


Subject Written By Posted
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 siu chan 09/20/2011 05:54AM
Re: 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 Barry Galbraith 09/20/2011 08:03PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.