\n"); // optionally print a bold header at top of table $column_count = mysql_num_fields($data) ; $headerBool = TRUE ; if($headerBool) { print(""); for($column_num = 0; $column_num < $column_count; $column_num++) { $field_name = mysql_field_name($data, $column_num); print("$field_name"); } print("\n"); } // print the body of the table while($row = mysql_fetch_row($data)) { print(""); for($column_num = 0; $column_num < $column_count; $column_num++) { print("$row[$column_num]\n"); } print("\n"); } print("\n"); } $dblink ; connectToTP2HSDB( $dblink ) ; $profileName = $_GET[ 'profilename' ] ; $profileName = mysql_real_escape_string( $profileName ) ; $query = "SELECT (SELECT COUNT(*) FROM scores si WHERE (si.milliseconds, si.profileID)<=(so.milliseconds,so.profileID) and si.levelID=so.levelID) as rank, levels.levelName, levels.type FROM scores so, levels WHERE so.profileID=(SELECT profileID FROM profiles WHERE name='$profileName') and so.levelID=levels.levelID" ; $result = mysql_query($query) or die( "query failed" ) ; printTable( $result ) ; /* $query = "DELETE scores.* FROM scores, ( SELECT profiles.profileID " ; $query .= "FROM profiles WHERE profiles.ownerID=( SELECT customers.customerID " ; $query .= "FROM customers WHERE customers.regkey='$regKey' ) ) " ; $query .= "as sprofs WHERE scores.profileID=sprofs.profileID" ; $result = mysql_query($query) or die( "query failed" ) ; $query = "DELETE profiles.* FROM profiles WHERE profiles.ownerID=( " ; $query .= "SELECT customers.customerID FROM customers WHERE " ; $query .= "customers.regkey='$regKey' )" ; $result = mysql_query($query) or die( "query failed" ) ; $query = "DELETE customers.* FROM customers WHERE customers.regkey='$regKey'" ; $result = mysql_query($query) or die( "query failed" ) ; print "succeeded" ; */ ?>