Tried that now, didn't work..It's not the users table, it's something with the user_info table; here is the SQL you need to input;
--
-- Rakenne taululle `user_info`
--
CREATE TABLE IF NOT EXISTS `user_info` (
`user_id` int(11) NOT NULL,
`bans` int(11) NOT NULL DEFAULT '0',
`cautions` int(11) NOT NULL DEFAULT '0',
`reg_timestamp` double NOT NULL DEFAULT '0',
`login_timestamp` double NOT NULL DEFAULT '0',
`cfhs` int(11) NOT NULL DEFAULT '0',
`cfhs_abusive` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Register Page:Post a screenshot of your user table here and the register page code.
<?php
if(isset($_POST['register'])){
$alertType = "danger"; // danger - warning - success - info
$alert = "Registration under construction.";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HabZen Hotel</title>
<meta name="description" content="HabZen, habbo, hotel, virtual, game" />
<link rel="stylesheet" href="/web-gallery/css/index.css" type="text/css" />
<link rel="stylesheet" href="/web-gallery/css/bootstrap.css" type="text/css" />
<link rel="shortcut icon" href="app/tpl/skins/{skin}/static/images/favicon.gif"/>
<script type="text/javascript" src="./web-gallery/js/jquery.min.js"></script>
<script type="text/javascript" src="./web-gallery/js/bootstrap.js"></script>
</head>
<body>
<div id="wrap-slash">
<div id="wrap-center">
<a href="index.php" id="logo"></a>
<div id="users-online">{online} Users Playing!</div>
</div>
</div>
<div id="wrap-body">
<div id="wrap-center">
<?php if(isset($alert)){ ?>
<div class="alert alert-<?php echo $alertType; ?>">
<?php echo $template->form->error; ?>
</div>
<?php } ?>
<div style="height:360px;">
<div id="register-left"></div>
<div id="register-right">
<div id="title">Register</div>
Enter the fields below to start playing.
<form id="register" method="post"><br />
<input type="text" name="reg_username" id="username" placeholder="Username" autofocus /><br />
<input type="text" name="reg_email" id="mail" placeholder="E-mail Adress" autofocus /><br />
<input type="password" name="reg_password" id="password" placeholder="Password" /><br />
<input type="password" name="reg_rep_password" id="password2" placeholder="Repeat Password" /><br />
<input type="submit" name="register" id="submit" value="" />
</form>
</div>
<div id="register-right2"></div>
</div>
<div id="logo_big"></div>
</div>
</div>
<div id="wrap-footer">
<div id="wrap-center">
Copyright © HabZen 2014. All rights reserved to their respective owner(s).<br />
HabZen is no way affiliated with Sulake Corporation Oy.
</div>
</div>
</body>
</html>
Shouldnt it be something in a table called "field list"?It's not the users table, it's something with the user_info table; here is the SQL you need to input;
--
-- Rakenne taululle `user_info`
--
CREATE TABLE IF NOT EXISTS `user_info` (
`user_id` int(11) NOT NULL,
`bans` int(11) NOT NULL DEFAULT '0',
`cautions` int(11) NOT NULL DEFAULT '0',
`reg_timestamp` double NOT NULL DEFAULT '0',
`login_timestamp` double NOT NULL DEFAULT '0',
`cfhs` int(11) NOT NULL DEFAULT '0',
`cfhs_abusive` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
noShouldnt it be something in a table called "field list"?
final public function addUser($username, $password, $email, $motto, $credits, $pixels, $rank, $figure, $gender, $seckey)
{
global $engine;
$sessionKey = 'RevCMS-'.rand(9,999).'/'.substr(sha1(time()).'/'.rand(9,9999999).'/'.rand(9,9999999).'/'.rand(9,9999999),0,33);
$engine->query("INSERT INTO users (username, password, mail, motto, credits, activity_points, rank, look, gender, seckey, ip_last, ip_reg, account_created, last_online, auth_ticket) VALUES('" . $username . "', '" . $password . "', '" . $email . "', '" . $motto . "', '" . $credits . "', '" . $pixels . "', '" . $rank . "', '" . $figure . "', '" . $gender . "', '" . $seckey . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . time() . "', '" . time() . "', '" . $sessionKey . "')");
$getUser = mysql_query("SELECT * FROM users WHERE username = '".$username."'");
while ($newUser = mysql_fetch_array($getUser))
{
$engine->query("INSERT INTO `bots` (`user_id`, `look`) VALUES ('".$newUser['id']."', '".$newUser['look']."')");
}
unset($sessionKey);
}
So how do I fix it?PHP:final public function addUser($username, $password, $email, $motto, $credits, $pixels, $rank, $figure, $gender, $seckey) { global $engine; $sessionKey = 'RevCMS-'.rand(9,999).'/'.substr(sha1(time()).'/'.rand(9,9999999).'/'.rand(9,9999999).'/'.rand(9,9999999),0,33); $engine->query("INSERT INTO users (username, password, mail, motto, credits, activity_points, rank, look, gender, seckey, ip_last, ip_reg, account_created, last_online, auth_ticket) VALUES('" . $username . "', '" . $password . "', '" . $email . "', '" . $motto . "', '" . $credits . "', '" . $pixels . "', '" . $rank . "', '" . $figure . "', '" . $gender . "', '" . $seckey . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . time() . "', '" . time() . "', '" . $sessionKey . "')"); $getUser = mysql_query("SELECT * FROM users WHERE username = '".$username."'"); while ($newUser = mysql_fetch_array($getUser)) { $engine->query("INSERT INTO `bots` (`user_id`, `look`) VALUES ('".$newUser['id']."', '".$newUser['look']."')"); } unset($sessionKey); }
Your problem is bots table.
Sort the bots table out, it's missing user_id column or even remove the bots insert query from that function.So how do I fix it?
Yea, that worked but now I got the error: "Field 'name' doesn't have a default value"Sort the bots table out, it's missing user_id column or even remove the bots insert query from that function.
while ($newUser = mysql_fetch_array($getUser))
{
$engine->query("INSERT INTO `bots` (`user_id`, `look`) VALUES ('".$newUser['id']."', '".$newUser['look']."')");
}
What EMU asre you using also, remove this aswel.Yea, that worked but now I got the error: "Field 'name' doesn't have a default value"
Edit: NVM I deleted:
And now it works like a charm! tyvm! BTW, will this disable any function becouse I deleted it?PHP:while ($newUser = mysql_fetch_array($getUser)) { $engine->query("INSERT INTO `bots` (`user_id`, `look`) VALUES ('".$newUser['id']."', '".$newUser['look']."')"); }
$getUser = mysql_query("SELECT * FROM users WHERE username = '".$username."'");