\n"; /* printing table headers */ for($i=0; $i<$fields_num; $i++) { $field = mysql_fetch_field($result); print "{$field->name}"; } print "\n"; /* printing table rows */ while($row = mysql_fetch_row($result)) { print ""; /* $row is array... foreach( .. ) puts * every element of $row into $cell variable */ foreach($row as $cell) print "$cell"; print "\n"; } print "\n"; } $username = $_REQUEST['username']; $q1 = "SELECT fullName FROM User_T WHERE username='$username'"; $r1 = mysql_query($q1); if (!$r1) die("Query to retrieve user failed"); $row = mysql_fetch_row($r1); print "

$row[0]

"; $q2 = "SELECT email FROM UserEmail_T WHERE username='$username'"; $r2 = mysql_query($q2); if (!$r2) die("Query to retrieve user email(s) failed"); DisplayTable($r2); mysql_free_result($r1); mysql_free_result($r2); ?>