Hierarchical employee management system, checkthemanualthatcorrespondstoyourMySQLserverversion what is the error? I used hierarchy as an employee management system. when I wrote the employee paging information, how could I see this prompt: Youhaveanerro hierarchy as an employee management system, check the manual that corresponds to your MySQL server version. what is the error?
I am working on an employee management system in layers. how can I prompt You have an error in your SQL syntax when writing to employee pages; check the manual that corresponds to your MySQL server version for the right syntax to use near '6' at line 1
I said I have never seen it before. what is the problem? how can I modify it?
Require_once 'sqlhelper. class. php ';
Class EmpService {
// Set the total number of pages for getting $ pageCount
Function getpageCount ($ pageSize ){
$ SQL = "select count (id) from emp ";
$ SqlHelper = new SqlHelper ();
$ Res = $ sqlHelper-> execute_dql ($ SQL );
If ($ row = mysql_fetch_row ($ res )){
$ PageCount = ceil ($ row [0]/$ pageSize );
}
Mysql_free_result ($ res );
Mysql_close ();
Return $ pageCount;
}
// Set the employee information that should be displayed
Function getempLiseByPage ($ pageSize, $ pageNow ){
$ SQL = "select * from limit". ($ pageNow-1) * $ pageSize. ", $ pageSize ";
$ SqlHelper = new SqlHelper ();
$ Res = $ sqlHelper-> execute_dql ($ SQL );
// Release the resource and close the connection
Mysql_free_result ($ res );
$ SqlHelper-> close_connect ();
Return $ res;
}
}
?>
------ Solution --------------------
PHP code
$sql="select * from limit ".($pageNow-1)*$pageSize.",$pageSize";