hello fellas
i'm stuck in this function:
function getDataForPagination() {
$sql = "select * from t_book limit 1, 15;
$result = mysql_query($sql);
if (!$result)
return false;
$num_rows = mysql_num_rows($result);
if ($num_rows == 0)
return false;
$result = dbResultToArray2($result);
return $result;
}
i want to make the above function more flexible by making it a function with parameters. I made it like this:
`
function getDataForPagination($table, $start, $amount) {
$sql = "select * '".$table."' limit '". $start ."' , '". $amount ."'";
$result = mysql_query($sql);
if (!$result)
return false;
$num_rows = mysql_num_rows($result);
if ($num_rows == 0)
return false;
$result = dbResultToArray2($result);
return $result;
}
But, it does not work
any help would be appreciated