July 29th, 2000, 06:16 AM
I want to add a file to many of my pages (i know to use include file to do this already) but i want it to be a randomly generated quote from my database. How do I make it random which quote pops up?
July 29th, 2000, 08:32 AM
what database r u using ??
July 30th, 2000, 01:24 AM
July 30th, 2000, 09:59 AM
Just check the mysql version .... the latest version has this feature ....
use can use :
select * from tablename order by rand()
But if the above doesn't work then the version of mysql doesn't have the random feature .... there is another way around it
firstly u have to have an auto increment column (won't work if u dont) .. say its called ID. Then the sql statement u would use would be:
select *, ID*0+rand() as rand_col from tablename order by rand_col
July 30th, 2000, 08:49 PM