Código PHP:
<?php
include("core/Config.php\");
class CMySql {
var $connection;
function CMySql() {
$this->connection = mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
mysql_select_db(SQL_DB, $this->connection) or die(mysql_error());
}
function register($username,$password,$email,$act) {
$q = "INSERT INTO ".TB_PREFIX."users (username,password,email,access,act) VALUES ('$username', '$password', '$email', ".USER.",'$act')";
if(mysql_query($q,$this->connection))
$uid = mysql_insert_id($this->connection);
else
$uid = 0;
$q = "INSERT INTO ".TB_PREFIX."reasearches (uid,R1,R2,R3,R4) VALUES ('$uid', '0', '0', '0')";
mysql_query($q,$this->connection);
$q = "INSERT INTO ".TB_PREFIX."barbarian VALUES (0,'$uid',1,1,0)";
mysql_query($q,$this->connection);
return $uid;
}