coder9 Posted July 19, 2008 Share Posted July 19, 2008 yo! How to determine which column name are not blank? in a record? and display the not empty column name? let say i have this table below. box1|box2|box3|box4|box5|box6|box7|box8|box9| ------------------------------------------------- ok | | | ok | | ok | | | ok | using loop thank you. Link to comment https://forums.phpfreaks.com/topic/115590-how-to-know-which-column-name-are-not-blank/ Share on other sites More sharing options...
coder9 Posted July 19, 2008 Author Share Posted July 19, 2008 sorry the alignment column of the table is not well aligned. Link to comment https://forums.phpfreaks.com/topic/115590-how-to-know-which-column-name-are-not-blank/#findComment-594219 Share on other sites More sharing options...
coder9 Posted July 19, 2008 Author Share Posted July 19, 2008 bump Link to comment https://forums.phpfreaks.com/topic/115590-how-to-know-which-column-name-are-not-blank/#findComment-594240 Share on other sites More sharing options...
coder9 Posted July 19, 2008 Author Share Posted July 19, 2008 i tried this one function check_selected_box() { //access all field name $query = "SELECT * FROM jtablegrid WHERE game_no = 1"; $result = mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); $row = mysql_fetch_row($result); $i=0; while($i <=100) { if($row[$i] != '') { echo "user" . $row[$i]; echo "<br>"; } } } but it display a blank page. i dunno what's causing the blank display? is that function that i created almost got the necessary logic. All i want really is to get all the not empty column names and display there column names. thanks in advance if someone will help me with this. sorry i can't edit my first post for this because there is no button to edit my first post that is why i can't fix the wrong words there. any help please. Link to comment https://forums.phpfreaks.com/topic/115590-how-to-know-which-column-name-are-not-blank/#findComment-594252 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.