positiverep
01-15-2009, 03:10 PM
My vBulletin install is in addition to the main part of my site which requires a separate registration. Once a user confirms their registration I want to automatically register them with my vBulletin forum also. The sql query to do so inserts the user's data into the user table in vBulletin alright, but the user cannot then log in using that data. Obviously there must be something missing from my query but I can't seem to find anything on the community forums or in the documentation.
The query is as follows:
$forum_password = MD5($password);
$date = date("Y-m-d"); // format 0000-00-00
$query = ("
INSERT INTO user
SET userid='0',
username='$user',
password='$forum_password',
passworddate='$date',
email='$email',
reputation='10',
reputationlevelid='1'
");
$result = mysql_query($query);
if ($result) {
echo "<p>".mysql_affected_rows()." record added to Forum members table for ".$user."</p>";
$forum_reg = true;
} else {
echo "<p>Error adding ".$user." to Forum members table.</p>";
$forum_reg = false;
}
I'd appreciate any help.
Thanks
The query is as follows:
$forum_password = MD5($password);
$date = date("Y-m-d"); // format 0000-00-00
$query = ("
INSERT INTO user
SET userid='0',
username='$user',
password='$forum_password',
passworddate='$date',
email='$email',
reputation='10',
reputationlevelid='1'
");
$result = mysql_query($query);
if ($result) {
echo "<p>".mysql_affected_rows()." record added to Forum members table for ".$user."</p>";
$forum_reg = true;
} else {
echo "<p>Error adding ".$user." to Forum members table.</p>";
$forum_reg = false;
}
I'd appreciate any help.
Thanks