salve ho tolto le variabili alla query lasciando le variabili come global , ma mi stampa un erroreperche trova le due variabile della query che seguono dopo limit le trova indefinite , però io le ho definite gia in un altra funzione cosa fare ?????codice:Notice: Undefined variable: ofsbgn in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\supp\includes\function_staff.php on line 81 Error 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 ' 1' at line 1Codice PHP:
function PagerTech()
{
global $page , $ofsppg ;
if (isset($_GET['page'])) {
$page = intval($_GET['page']);
} else { $page = 1; }
$ofsppg = 1; //Items per page
$ofsbgn = ($page*$ofsppg)-$ofsppg;
if(empty($page) or empty($ofsppg))
{
exit("query vuote");
}
require_once 'classi/pagerclass.php';
$pager = new pager();
$query = "select * from tech where staffid = staffid ";
$sql = mysql_query($query );
$total = mysql_num_rows($sql);
$pager->override_query = $total;
$pager->items = $ofsppg;
$pager->actpg = $page;
$pager->url = "index.php?_m=content&_s=managestaff&page={{N}}";
echo $pager->show();
}

Rispondi quotando