
Originally Posted by
Tha
To be honest I think Makarov is jealous.
To argue about this CMS is bad, it's a really good CMS and I must admit that.
This helps anybody and another reason to use MySQLi over MySQL is that MySQL is old and MySQLi is better.
True with that. But for example this:
PHP Code:
public function addUser($username, $passwordHash, $email, $rank, $figure, $sex, $motto, $homeroom) {
global $db, $core;
if($this->stmt = $db->prepare("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,home_room,credits,activity_points,last_online,account_created,ip_last,ip_reg) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "', '" . $motto . "', '" . $homeroom . "','15000','1000','','" . date('d-M-Y') . "', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['REMOTE_ADDR']."')")) {
$this->stmt->execute();
$this->stmt->close();
}
else {
$db->databaseError($db->error);
}
}
Is the worse example I've seen, it's not bad but he could better use parameters for that.
Would even look better to lol.
PHP Code:
public function addUser($username, $passwordHash, $email, $rank, $figure, $sex, $motto, $homeroom) {
global $db, $core;
$stmt = $db->stmt_init();
if (!$stmt->prepare("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,home_room,credits,activity_points,last_online,account_created,ip_last,ip_reg) VALUES (?,?,?,?,?,?,?,?,','15000','1000','',?,?,?,?)"))
{
$db->databaseError($stmt->error);
return;
}
this->stmt->bind_param('sssisssisss', $username, $passwordHash, $email, $rank, $figure, $sex, $motto, $homeroom, date('d-M-Y'), $_SERVER['REMOTE_ADDR'], $_SERVER['REMOTE_ADDR']);
if (!$stmt->execute())
{
$db->databaseError($stmt->error);
return;
}
$stmt->close();
}
But yhee, I think that's just me :c