[PHP] Additional query for number of records in table

2006-11-17 Thread afan
hi, I have query to select products for specific category from DB, something like: SELECT prod_id, prod_name,... FROM products LIMIT $From, $To where $From and $To values depend of on what page you are. let say there are 100 products and I'm listing 25 products per page. for page 1 $From=0,

Re: [PHP] Additional query for number of records in table

2006-11-17 Thread Brad Bonkoski
[EMAIL PROTECTED] wrote: hi, I have query to select products for specific category from DB, something like: SELECT prod_id, prod_name,... FROM products LIMIT $From, $To where $From and $To values depend of on what page you are. let say there are 100 products and I'm listing 25 products per

Re: [PHP] Additional query for number of records in table

2006-11-17 Thread afan
[EMAIL PROTECTED] wrote: hi, I have query to select products for specific category from DB, something like: SELECT prod_id, prod_name,... FROM products LIMIT $From, $To where $From and $To values depend of on what page you are. let say there are 100 products and I'm listing 25 products

RE: [PHP] Additional query for number of records in table

2006-11-17 Thread Ray Hauge
I've run into this before, and if you use MySQL you can do something like this: SELECT SQL_CALC_FOUND_ROWS * FROM Products LIMIT $From, $To SELECT FOUND_ROWS() http://dev.mysql.com/doc/refman/5.0/en/information-functions.html The second query will give you the number of rows that would have

RE: [PHP] Additional query for number of records in table

2006-11-17 Thread afan
I've run into this before, and if you use MySQL you can do something like this: SELECT SQL_CALC_FOUND_ROWS * FROM Products LIMIT $From, $To SELECT FOUND_ROWS() http://dev.mysql.com/doc/refman/5.0/en/information-functions.html The second query will give you the number of rows that would