Re: Re Displaying Text From A Data File
| From: | Peter Ellis | Date: | Sat, 04 Sep 2004 19:07:57 +0000 |
| Subject: | Re: Re Displaying Text From A Data File | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-36041@lists.php.net to get a copy of this message | ||
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 - pellis@naturalaxis.com
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: <001b01c492a9$275ab1c0$95703ad8@ron>
> >From: "Ron Piggott" <ron.php@actsministries.org>
> >To: "PHP DB" <php-db@lists.php.net>
> >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.
>