dbx Posted December 2, 2008 Share Posted December 2, 2008 Hi, I hope this is in the right section. I'm not sure if this is more css or php. I'd accept a solution in css or php... I'm taking about 20 items from a database: First name, surname, age, DOB etc Some of these items will have values stored and some will not. When my script takes them from the database, I am displaying them in 4 columns across the page (5 per column) At the moment, each column only displays certain values. E.g. first column contains name, surname, age, dob, location If the age is missing, nothing is printed and only 4 items will be displayed in that column. If the surname, age, dob and location are missing, only the first name would be displayed, resulting in only 1 item in that whole column. How can i change things so that if something is missing, something from one of the other items will fall into its place? I would rather have 3 complete columns from left to right and nothing in the fourth than 2 items in the first, 5 items in the second, 4 items in the third and 4 in the fourth. Thanks. Link to comment https://forums.phpfreaks.com/topic/135118-displaying-data/ Share on other sites More sharing options...
elite_prodigy Posted December 2, 2008 Share Posted December 2, 2008 Wouldn't that be a pointless way to sort the data though? If you do it the way you are talking about, you would mix Bob's info with Fred's. Please maybe try to elaborate more. Link to comment https://forums.phpfreaks.com/topic/135118-displaying-data/#findComment-703785 Share on other sites More sharing options...
dbx Posted December 2, 2008 Author Share Posted December 2, 2008 the page i'm talking about only displays data on one individual, so now data would be mixed. Link to comment https://forums.phpfreaks.com/topic/135118-displaying-data/#findComment-703794 Share on other sites More sharing options...
waynew Posted December 2, 2008 Share Posted December 2, 2008 Show us your code. if($row['name'] == NULL){ echo 'No name'; } Link to comment https://forums.phpfreaks.com/topic/135118-displaying-data/#findComment-703802 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.