I got trouble with this php coding
when this file is launched, it just says
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
Can you help me figure out what is wrong?
<?php
$open=mysql_connect('localhost','ID','PW') or die(mysql_error());
mysql_select_db('personal_info',$open);
$tablename='writing';
if($page=='') $page=1;
$list_num=10;
$page_num=10;
$offest=$list_num*($page-1);
$query="select * from $tablename";
$result=mysql_query($query) or die(mysql_error());
row=mysql_fetch_row($result);
$total_no=$row[0];
$total_page=ceil($total_no/$list_num);
$cur_num=$total_no - $list_num*($page-1);
$query="select*from $tablename order by number desc limit $offset, $list_num";
$result=mysql_query($query) or die (mysql_error());
?>