Re Displaying Text From A Data File
| From: | Neil Smith [MVP, Digital media] | Date: | Sat, 04 Sep 2004 18:59:51 +0000 |
| Subject: | Re Displaying Text From A Data File | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-36040@lists.php.net to get a copy of this message | ||
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;======================================================== 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.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