View Single Post
Old 01-26-2022, 08:36 PM  
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,141
Quote:
Originally Posted by NoWhErE View Post
you'd have to save all the names as an array. I don't know if your data is available in that format, but if it is, all you need to do is $random_title = array_rand($your_array_of_names) and it will output a random result every time.

if your data isn't an array yet, you can create one by adding each name in your database like this

step 1: create an empty array
$array = array();

step 2: go through each name in your db and add it to the array
foreach($row as $name) {
$array[] = $name;
}

now your array is ready to be randomized.
Much appreciated.

Thats what I was afraid of, itll take forever to setup the individual arrays, looks like I need to recode using SQL Queries instead

Thanks!
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote