$linkid = mysql_pconnect( "localhost", "nobody", "oct1497") or die( "Unable to connect to mySQL server");
if (isset($quickQuery1)) { $sql = "SELECT * FROM Test_Table";
if ($order_tests_by) { $sql .= " ORDER BY $order_tests_by"; }
}
if (isset($quickQuery2)) { $sql = "SELECT test_id,subtest_number,status,appearance,comments,date,timing FROM SubTest_Table";
if ($order_subtests_by) { $sql .= " ORDER BY $order_subtests_by"; }
}
if ($order) { $sql .= " ".$order; }
if ($limit) { $sql .= " LIMIT 0, $limit"; }
if (isset($showtables)) { $sql = "show tables"; }
if (isset($Report1)) { $sql = "SELECT test_id, Player_Table.guid, user_id, first_name FROM Player_Table,Test_Table,User_Table WHERE Player_Table.guid LIKE Test_Table.guid AND user_id = user_table_id ORDER BY first_name"; }
if (isset($Report2)) { $sql = "SELECT Test_Table.test_id, Player_Table.guid, user_id, first_name, email, Test_Table.videocard_mem, Player_Table.videocard_mem, SubTest_Table.subtest_number, SubTest_Table.status, SubTest_Table.appearance, SubTest_Table.comments, SubTest_Table.date from Player_Table,Test_Table,User_Table,SubTest_Table where Player_Table.guid like Test_Table.guid and user_id = user_table_id and Test_Table.test_id = SubTest_Table.test_id order by user_id, guid, test_id, subtest_number"; }
if (isset($Report3)) { $sql = "SELECT Test_Table.test_id, Player_Table.guid, user_id, first_name, email, Test_Table.videocard_mem, Player_Table.videocard_mem, SubTest_Table.subtest_number, SubTest_Table.status, SubTest_Table.appearance, SubTest_Table.comments, SubTest_Table.date from Player_Table,Test_Table,User_Table,SubTest_Table where Player_Table.guid like Test_Table.guid and user_id = user_table_id and Test_Table.test_id = SubTest_Table.test_id and ( status = 0 or appearance = 0 ) order by subtest_number, SubTest_Table.test_id"; }
?>
Error_Reporting(7);
if ($REQUEST_METHOD == "POST")
{
$result = mysql_db_query("wt_client",$sql);
if ($result < 0)
{
echo "\n";
echo mysql_errno().": ".mysql_error()." ";
echo " \n";
}
else
{
$nr = mysql_numrows($result);
$fn = mysql_numfields($result);
$i = 0;
$j = 0;
echo "\nResults: ",$nr," \n";
echo " ";
echo "\n";
while ($i < $fn) {
$f[] = mysql_fieldname($result,$i);
echo "",$f[$i]," | ";
$i++;
}
echo " \n";
while ($j < $nr) {
$k = 0;
if ( ($j % 2) == 0 ) {
echo "";
}
else {
echo " ";
}
while ($k < $fn) {
echo "";
if ($f[$k] == "test_id") {
$test_id = mysql_result($result,$j,$f[$k]);
echo "$test_id";
}
else { echo mysql_result($result,$j,$f[$k]);}
echo "
| ";
$k++;
} /* while $k */
$j++;
echo " \n";
} /* while $j */
echo " \n";
}
}
?>
WildTangent_mySQL_test_db.txt: The Database Layout
WildTangent_mySQL_db.txt: mySQL Permissions Table
You can also ssh or telnet in to the server and type "mysql -v -v wt_test".
|