Forum Moderators: coopster

Message Too Old, No Replies

testimonial php script

trying to find simple php script for including testimonials

         

wyattea

10:27 pm on Jan 21, 2008 (gmt 0)

10+ Year Member



I've been searching everywhere for a simple php script that pulls a quote from a mysql db randomly or can display them all on one page or spread over multiple pages. My php scripting knowledge is limited - more of an 'editing' skill then a writing skill. Anyone have a php/mysql script to handle this? I can setup the table but it's the php code that I have difficulty with. I would just add a table to my existing cart db so I wouldn't need to open a connection (will already be open). Any help is appreciated.

Regards,

James...

dreamcatcher

8:14 am on Jan 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi James,

Do you need a database? Have you thought of just storing the quotes in an array and then just pulling a random quote from the array? A database seems overkill for something like this. Just a thought.

dc

[edited by: dreamcatcher at 4:44 pm (utc) on Jan. 22, 2008]

wyattea

12:12 pm on Jan 22, 2008 (gmt 0)

10+ Year Member



Hi dreamcatcher, i have 100+ quotes and dozens more to add (still sitting in my email inbox). I don't think an array would be a good solution.

James...

omoutop

1:14 pm on Jan 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



assuming you will use a mysql database the following syntax will come handy to you:
SELECT * FROM [table_name] ORDER BY RAND() LIMIT 1

wyattea

6:32 pm on Jan 22, 2008 (gmt 0)

10+ Year Member



thanks guys, works great!

James...