If it were a database, this would make sense.  He's asking about a text-
based file.  This isn't really a database issue -- there's a lot of what
are called "fortune scripts" out there that do exactly what you want.
Do a search on Google.
-- 
Peter Ellis - [EMAIL PROTECTED]
Web Design and Development Consultant
naturalaxis | http://www.naturalaxis.com/

On Sat, 2004-09-04 at 19:59 +0100, Neil Smith [MVP, Digital media]
wrote:
> It's actually very simple : Just use
> 
> SELECT * FROM tbl_name ORDER BY RAND() LIMIT 1
> 
> Cheers - Neil
> 
> 
> At 17:35 04/09/2004 +0000, you wrote:
> >Message-ID: <[EMAIL PROTECTED]>
> >From: "Ron Piggott" <[EMAIL PROTECTED]>
> >To: "PHP DB" <[EMAIL PROTECTED]>
> >Date: Sat, 4 Sep 2004 14:00:56 -0400
> >MIME-Version: 1.0
> >Content-Type: text/plain;
> >         charset="iso-8859-1"
> >Content-Transfer-Encoding: 7bit
> >Subject: Displaying Text From A Data File
> >
> >I am still new to PHP and I wanted to ask a question.
> >
> >I am wanting to create a PHP script to randomly display one of many greeting
> >messages on my web site.  I was going to store them in a text based file.  I
> >wanted PHP to randomly select one of them and display it each time the
> >script was loaded.
> >
> >I am still new at PHP and I am not sure where to get started.  But I was
> >thinking about this and I am sure this has already been done many times ...
> >I am not sure where to look on the web.
> >
> >Can any of you help me get started?
> >
> >Ron
> 
> 
> ========================================================
> CaptionKit http://www.captionkit.com : Production tools
> for accessible subtitled internet media, transcripts
> and searchable video. Supports Real Player, Quicktime
> and Windows Media Player.
> 
> VideoChat with friends online, get Freshly Toasted every
> day at http://www.fresh-toast.net : NetMeeting solutions
> for a connected world.
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to