Initial Commit

This commit is contained in:
Robert Fritzen 2014-06-19 13:43:37 -05:00
commit 75b8614a44
421 changed files with 36000 additions and 0 deletions

42
Quiz/Lib/functions.php Normal file
View 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;
}
?>