Game Database Direct SQL Access
Table Descriptions

\n"; mysql_select_db($database) or die('Could not select database'); $genericquery="SET NAMES 'utf8'"; $genericresult=mysql_query($genericquery); $result = mysql_query($query) or die('Query failed: ' . mysql_error()); // Printing results in HTML echo "\n"; //Headers $fields = mysql_numfields($result); echo "\t\n"; for ($i = 0; $i < $fields; $i++) { echo "\t\t\n"; } echo "\t\n"; //The rest while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "\t\n"; foreach ($line as $col_value) { echo "\t\t\n"; } echo "\t\n"; } echo "
".mysql_fieldname($result, $i)."
\n"; // Free resultset mysql_free_result($result); // Closing connection mysql_close($link); $username="###"; $password="###"; $database="###"; $link = mysql_connect(localhost, $username, $password); mysql_select_db($database); $genericquery="SET NAMES 'utf8'"; $genericresult=mysql_query($genericquery); $queryslash=addslashes($query); if(empty($queryid)) { //If no $queryid, make one... or see if it already exists. $genericquery="SELECT QueryID FROM SQLDirect WHERE Query='$queryslash'"; $genericresult=mysql_query($genericquery); $genericnum=mysql_numrows($genericresult); if($genericnum==1) { //It's already there $queryid=mysql_result($genericresult,"QueryID"); //Now let's update it; treat it as if that ID had been selected. $genericquery="UPDATE SQLDirect SET AccessCount=AccessCount+1, LastAccess=Now() WHERE QueryID=$queryid"; $genericresult=mysql_query($genericquery); } else { //We need to add it in $genericquery="SELECT Max(QueryID) as Max FROM SQLDirect"; $genericresult=mysql_query($genericquery); $queryid=mysql_result($genericresult,"Max")+1; $genericquery="INSERT INTO SQLDirect (Query,QueryID,AccessCount,LastAccess) VALUES('$queryslash',$queryid,0,Now())"; $genericresult=mysql_query($genericquery); } } mysql_close($link); } ?>

Permanent link to this query.