View Single Post
Old 12-19-2021, 03:20 PM  
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
Quick PHP question, random data and limits

So i have a table that contains a range of columns, some of them fill the entire set of rows, some of them have say, 10 items in the column, while I have 25 rows.

This is the querie that I am using to display the data:

Quote:
$sql = "SELECT ColumnName FROM Table ORDER BY RAND() LIMIT 1";
I understand why its only displaying blank fields in some areas of my PHP coding (because its randomly pulling row data that doesnt exist in a column), however, how would I change the above querie to FORCE data to be displayed for a specific column, whether its full or only 1/2 full with data?

Hopefully, that makes sense?
__________________
NOTHING TO SEE HERE
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote