![]() |
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:
Hopefully, that makes sense? |
Quote:
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 . |
Quote:
I've tried both but neither seems to work, the page still displays empty data for some reason :/ Quote:
Quote:
All rows are currently 'null' in the table and are also set as 'longtext' (If that matters?) :helpme |
Null and empty are not the same thing. Null is used to refer to nothing and empty is a string with zero length.
SELECT * FROM table WHERE column != '' ORDER BY RAND() LIMIT 1 |
Quote:
Any chance you could explain why for me though? What does that != do that a regular query doesnt? |
Quote:
An empty string is not null, it's an empty string. |
Quote:
|
Quote:
|
Quote:
|
All times are GMT -7. The time now is 10:25 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc