我已经加多一个SQL语句查总记录数,但现在只要分页就有一个报错:
Warning: mysql_data_seek() [function.mysql-data-seek]: Offset 60 is invalid for MySQL result index 64 (or the query data is unbuffered) in D:\php\website\Web_en\product_list.php on line 130
if (strtoupper($_GET['key1'])=="" and strtoupper($_GET['key2'])=="" and strtoupper($_GET['key3'])=="" and strtoupper($_GET['key4'])==""){
$sql = "select product_info.product_id, product_info.product_name, product_info.input, product_info.output, product_info.category, product_info.category0, product_info.category1, product_info.category2, product_info.category3, product_info.image_path, product_attachment.path from product_info,product_attachment where product_info.product_id like product_attachment.product_id order by rand() limit 15";
}else{
if (strtoupper($_GET['key1'])<>""){
$sql = "select product_info.product_id, product_info.product_name, product_info.input, product_info.output, product_info.category, product_info.category0, product_info.category1, product_info.category2, product_info.category3, product_info.image_path, product_attachment.path from product_info,product_attachment where product_info.category0 like '".$_GET['key1']."' and product_info.product_id like product_attachment.product_id order by order_by desc";
if (strtoupper($_GET['key2'])<>"")
$sql = "select product_info.product_id, product_info.product_name, product_info.input, product_info.output, product_info.category, product_info.category0, product_info.category1, product_info.category2, product_info.category3, product_info.image_path, product_attachment.path from product_info,product_attachment where product_info.category1 like '".$_GET['key2']."' and product_info.product_id like product_attachment.product_id order by order_by desc";
if (strtoupper($_GET['key3'])<>"")
$sql = "select product_info.product_id, product_info.product_name, product_info.input, product_info.output, product_info.category, product_info.category0, product_info.category1, product_info.category2, product_info.category3, product_info.image_path, product_attachment.path from product_info,product_attachment where product_info.category like '".$_GET['key3']."' and product_info.product_id like product_attachment.product_id order by order_by desc";
if (strtoupper($_GET['key4'])<>"")
$sql = "select product_info.product_id, product_info.product_name, product_info.input, product_info.output, product_info.category, product_info.category0, product_info.category1, product_info.category2, product_info.category3, product_info.image_path, product_attachment.path from product_info,product_attachment where product_info.category2 like '".$_GET['key4']."' and product_info.product_id like product_attachment.product_id order by order_by desc";
}
}