function user_get_data($id) { global $_CONF, $DBc_char; $DBc_align = new mySQL($_CONF['mysql_error']); $DBc_align->connect($_CONF['char_mysql_server'], $_CONF['char_mysql_user'], $_CONF['char_mysql_pass'], $_CONF['char_mysql_database']); $res = $DBc_char->sqlQuery("SELECT cid FROM players WHERE id='" . $DBc_char->sqlEscape($id) . "'"); $res = $DBc_align->sendSQL("SELECT race,civilisation,cult FROM characters WHERE char_id='" . $res[0]['cid'] . "'", "ARRAY"); return $res[0]; }
$_DATASOURCE->addSource($tmp); } #REPLACE WITH REGEX!!! $tmp = explode("/", $_REQUEST['file']); $tmp2 = explode("_", $tmp[sizeof($tmp) - 1]); $DBc->database($CONF['webig_mysql_database']); $res = $DBc->sendSQL("SELECT id FROM players WHERE cid='" . $DBc->mre($tmp2[1] * 16 + $tmp2[2]) . "' AND deleted='0'", "ARRAY"); #$res[0]['id'] = 1; if ($res[0]['id'] > 0 == false) { $log->logf("ERROR: no character found!"); $log->close(); die; } $cdata = array("cid" => $res[0]['id'], "aid" => $tmp2[1], "sid" => $tmp2[2]); $DBc_char = new mySQL($CONF['mysql_error']); $DBc_char->connect($CONF['char_mysql_server'], $CONF['char_mysql_user'], $CONF['char_mysql_pass'], $CONF['char_mysql_database']); $res = $DBc_char->sendSQL("SELECT race,civilisation,cult FROM characters WHERE char_id='" . $DBc_char->mre($tmp2[1] * 16 + $tmp2[2]) . "'", "ARRAY"); $cdata['race'] = $res[0]['race']; $cdata['civ'] = $res[0]['civilisation']; $cdata['cult'] = $res[0]['cult']; #$cdata = array("cid"=>1,"aid"=>1,"sid"=>1); $DBc->database($CONF['mysql_database']); #echo var_export($cdata); #$log->logf(" done!"); $microstop = explode(' ', microtime()); $stop_time = $microstop[0] + $microstop[1]; #$log->logf("Expired time: ".($stop_time - $start_time)); #foreach($chars as $cid) { #STEP 1: load and register atoms $log->logf("Processing char '" . $cdata['cid'] . "' (" . $cdata['race'] . "," . $cdata['cult'] . "," . $cdata['civ'] . ") ... "); #$log->logi("Loading and registering Atoms... ",false);
<?php include 'connection_class.php'; $connect = new mySQL(); $connect2 = new mySQL(); $connect->connect('localhost', 'root', 'root', 'user_registration'); //testing the connection class to see if it works I should be able to initiate two or more connections //$connect2->connect('localhost','roots','root','guestbook');
{ return "%"; } function getCiv() { return "%"; } function getRace() { return "%"; } } $_USER = new RUser(); //create database connection $DBc = new mySQL($_CONF['mysql_error']); $DBc->connect($_CONF['mysql_server'], $_CONF['mysql_user'], $_CONF['mysql_pass'], $_CONF['mysql_database']); echo '<?xml version="1.0" ?><ryzom_achievements>'; function print_cat(&$iter3) { while ($iter3->hasNext()) { $curr3 = $iter3->getNext(); echo "<achievement id='" . $curr3->getID() . "' parent='" . $curr3->getParentID() . "' image='" . $_CONF['image_url'] . "pic/icon/" . $curr3->getImage() . "'><name><![CDATA[" . $curr3->getName() . "]]></name><ties>"; if ($curr3->getTieRace() != null) { echo "<tie type='race'>" . $curr3->getTieRace() . "</tie>"; } if ($curr3->getTieCult() != null) { echo "<tie type='cult'>" . $curr3->getTieCult() . "</tie>"; } if ($curr3->getTieCiv() != null) { echo "<tie type='civilization'>" . $curr3->getTieCiv() . "</tie>"; }