PHP mysqli help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So I have:

$result = $dbh->query ("select * from roles order by name");
$row = mysqli_fetch_object ($result);

function process_field ($which) {
	// This fails, I need to know how to do this the right way
	if ($row->may_$which == 'Y') {
		// Print stuff
	} else {
		// Print other stuff
	}
}

There's a field "may_basic" in roles. I need to call
process_field ("basic"). If I need to pass the string "may_basic" it
will work also.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux