mirror of
https://github.com/PhantomGamesDevelopment/PGD-Connect--Tribes-2-.git
synced 2026-07-16 00:34:42 +00:00
Initial Commit
This commit is contained in:
commit
75b8614a44
421 changed files with 36000 additions and 0 deletions
42
Quiz/Lib/functions.php
Normal file
42
Quiz/Lib/functions.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
//Functions.php
|
||||
//Phantom139 For Phantom Games Development
|
||||
//Copyright 2010
|
||||
function applyField($user, $field, $set) {
|
||||
$con = mysql_connect("localhost","","");
|
||||
if(!$con) {
|
||||
die('Could not connect: ' . mysql_error());
|
||||
}
|
||||
mysql_select_db("phantom7_Quiz", $con);
|
||||
|
||||
mysql_query("UPDATE User SET ".$field." = '$set' WHERE GUID = '$user'");
|
||||
|
||||
}
|
||||
|
||||
function obtainField($user, $field) {
|
||||
$con = mysql_connect("localhost","","");
|
||||
if(!$con) {
|
||||
die('Could not connect: ' . mysql_error());
|
||||
}
|
||||
mysql_select_db("phantom7_Quiz", $con);
|
||||
$result = mysql_query("SELECT * FROM User WHERE GUID = '$user'");
|
||||
$row = mysql_fetch_array($result);
|
||||
|
||||
return $row[$field];
|
||||
}
|
||||
|
||||
function guidExistsInUserDB($field) {
|
||||
$con = mysql_connect("localhost","","");
|
||||
if(!$con) {
|
||||
die('Could not connect: ' . mysql_error());
|
||||
}
|
||||
mysql_select_db("phantom7_Quiz", $con);
|
||||
$result = mysql_query("SELECT * FROM User WHERE GUID = '$field'");
|
||||
$row = mysql_fetch_array($result);
|
||||
if(isSet($row["GUID"])) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue