[SOLVED] I need some query help
Hello RZ
Well i need some query help
i need a query to get id of user so it can insert it into user_info
i try to make one myself but it seems like it does not work so i could need some help
$get_id = $_GET['id']
$query = ("SELECT * FROM users WHERE id='$get_id'")
while($row = mysql_fetch_assoc($query))
$engine->query("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . $row . "','0','0','" . time(). "','" . time() . "','0','0')");
Best Regards Evisu
[MySQL] I need some query help [RevCMS]
Where are you placing this?
Re: [MySQL] I need some query help [RevCMS]
Quote:
Originally Posted by
Vrop93
Where are you placing this?
class_user.php
Re: [MySQL] I need some query help [RevCMS]
You could try replacing the add user function with this:
PHP Code:
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 . "')");
$id = mysql_insert_id();
$engine->query("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . $id . "','0','0','" . time(). "','" . time() . "','0','0')");
unset($sessionKey);
}
Re: [MySQL] I need some query help [RevCMS]
Quote:
Originally Posted by
Vrop93
You could try replacing the add user function with this:
PHP Code:
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 . "')");
$id = mysql_insert_id();
$engine->query("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . $id . "','0','0','" . time(). "','" . time() . "','0','0')");
unset($sessionKey);
}
Thanks, i will try it out now.
EDIT: It workes great thank you man! You made my day! :)