Re: Search Engine

From: Date: Sat, 07 Oct 2000 20:46:29 +0000
Subject: Re: Search Engine
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-19057@lists.php.net to get a copy of this message
You probably want to take a look at the mysql_data_seek function which allows you to start the output from anywhere in the query's result set. http://www.php.net/manual/function.mysql-data-seek.php The other option is to do it in mysql use the Limit FirstRow,TotalRows function. I.E.: Select * from news order by date desc limit 0,30 for the first thirty rows. --Matt ----- Original Message ----- From: "Dhaval Desai" <dhaval_adams@yahoo.com> To: <php-general@lists.php.net> Sent: Saturday, October 07, 2000 4:38 PM Subject: [PHP] Search Engine > Hi > > Guys This is my code..: I want a maximum of ten > entrieds to display..Howz that possible..and then I > want other 10 to display when I click nex link which > has to be added > > <?php > > $connect = mysql_connect(); > $query = "select * from news ORDER BY date DESC "; > > $news = mysql_db_query("website", $query); > > $i == 0; > while ($newsx = mysql_fetch_array($news)) > { > if($i == 6) > { > break; > } > $i++; > > $title = $newsx['title']; > $author = $newsx['author']; > $body = $newsx['body']; > $id = $newsx['id']; > $date = $newsx['date']; > > echo "<b>$id</b>"; > echo "<a > href=\"innernews.php3?id=$id\"<b>$title</b></a>" . > "<br>"; > echo "$date" . "<br>"; > echo "<b>$author</b>" . "<br><br>"; > > } > ?> > > Thank You in advance > Dhaval Desai > > __________________________________________________ > Do You Yahoo!? > Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free! > http://photos.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#19057) next »