I\'ve wrote a query to check for users with certain criteria, one being they have an email address.
Our site will allow a user to have or not have an email address.<
$sql = "SELECT * FROM tablename WHERE condition"; $res = mysql_query($sql); while ($row = mysql_fetch_assoc($res)) { foreach($row as $key => $field) { echo ""; if(empty($row[$key])){ echo $key." : empty field :".""; }else{ echo $key." =" . $field.""; } } }