Jump to content

How to know which column name are not blank?


coder9

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.