Hola,
Prueba cambiando:
Código PHP:
$sql = 'SELECT p.testdim,p.testdate, p.milk, p.fat,p.scc,p.prot,p.herd_id, h.herd_id, h.codi, a.parity,a.endparitydate
FROM production p , herd h, ag_parity a
WHERE p.TESTDATE > \'2008-05-01\'
and a.endparitydate > \'2007-05-01\'
and p.herd_id= a.herd_id
and a.herd_id= h.herd_id
order by h.codi
LIMIT $a,$b';
Por:
Código PHP:
$sql = 'SELECT p.testdim,p.testdate, p.milk, p.fat,p.scc,p.prot,p.herd_id, h.herd_id, h.codi, a.parity,a.endparitydate
FROM production p , herd h, ag_parity a
WHERE p.TESTDATE > \'2008-05-01\'
and a.endparitydate > \'2007-05-01\'
and p.herd_id= a.herd_id
and a.herd_id= h.herd_id
order by h.codi
LIMIT '.$a.','.$b;
Suerte
Salu2