View Single Post
Old 12-19-2021, 09:14 PM  
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
Quote:
Originally Posted by sarettah View Post
If the empty fields are nulls then

Select field-name from table where field-name is no null order by rand() ....

Would work. If there are blank fields that are not null then

Select field-name from table where field-name>'' order by rand() ...

should work

.
Thanks,

I've tried both but neither seems to work, the page still displays empty data for some reason :/

Quote:
$sql = "SELECT Culumn FROM Table WHERE Column IS NULL ORDER BY RAND() LIMIT 1";
Quote:
$sql = "SELECT Column FROM Table WHERE Column IS NOT NULL ORDER BY RAND() LIMIT 1";
The column has 4 rows of data on 20 rows.

All rows are currently 'null' in the table and are also set as 'longtext' (If that matters?)
__________________
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