[PHP-DB] RE: Search results

2002-02-06 Thread Andrew Chase
You can use mysql_result_rows() to check whether any rows were returned; something like: ? if(mysql_result_rows($result) 0){ while ($row = mysql_fetch_array($result)) { //Do stuff with result rows here } }else{ echo Sorry your search returned Zero

Re: [PHP-DB] RE: Search results

2002-02-06 Thread Chris Boget
You can use mysql_result_rows() to check whether any rows were returned; something like: you mean: mysql_num_rows(); ? Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] RE: Search results

2002-02-06 Thread Andrew Chase
Yes, sorry about that. :P I need to eat lunch now. -Andy -Original Message- From: Chris Boget Subject: Re: [PHP-DB] RE: Search results you mean: mysql_num_rows(); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Re: Search Results - Next 10 records

2001-09-03 Thread Marcus Tobias
Hi Dennis! You can add the parameter LIMIT to your SQL query. Syntax: LIMIT $start_record,$record_count Example: $query_string = select * from $table where keywords like '%$keyword%' limit 5,3; This will return 3 records started with the 5. found record. The startrecord has to increase on next

Re: [PHP-DB] Re: Search Results - Next 10 records

2001-09-03 Thread hassan el forkani
hi ...and to be able to know the exact number of pages do $result = mysql_query(select count(*)); $nb_pages = $result/$nb_records_per_page; et voila! add this to marcus's suggestion and you have a full paging script, if you want some inspiration check out http://phpclasses.upperdesign.com i

[PHP-DB] Re: Search Results - Next 10 records

2001-09-03 Thread Dennis Butler
Thanks very much Marcus. It worked like a charm. Dennis On Mon, 3 Sep 2001 14:02:07 +0200, [EMAIL PROTECTED] (Marcus Tobias) wrote: Hi Dennis! You can add the parameter LIMIT to your SQL query. Syntax: LIMIT $start_record,$record_count Example: $query_string = select * from $table where