Question External Registration ( phpBB phpBB 2.0.x 2.0.x Discussion ) Updated: 2008-11-23 09:25:08 (6) |
|
External Registration
Hi,
I am working on a site where people can register for more features, including the forum. But now they have to register twice; once for the forum and once for the site.. How can it be made possible for users to only enter their info once, but the info is submitted to 2 tables, the forum and the site? Using PHP + MySQL, phpBB 2.0.2...
Thanks.
[edit] If possible, I would also like people to login once.. But that's less important then registering.
|
|
| Answers: External Registration ( phpBB phpBB 2.0.x 2.0.x Discussion ) |
|
External Registration
$strQuery = "SELECT MAX(user_id) AS total FROM phpbb_users"; $result = mysql_query($strQuery); $row = mysql_fetch_row($result); $new_user_id = $row['total'] + 1; unset($result); unset($row);
damned why doesnt that work on my page? i cant see any mistake if i make a little echo var_dump($row) (before the unset) i'll get array(1) { [0]=> string(1) "2" } which is right echo var_dump($new_user_id) ==>int(1) ??wtf? anyone of you? can anyone help me?
greets bjb bjb
|
|
External Registration
Hi DanceTrend - did you get this to work?
I have a similar issue in that I have an external website as well...but my biggest concern is that I don't want people to be able to access the forum unless they've first registered with our website.
I'd like to set it up so that when users registered with our website, they are automatically registered in the forum database. But I'm using Access for the website, and MySQL for the forum, so I don't know if I can do that.
Did you get this working for your site?
Thx! christy_nf
|
|
External Registration
Dance-
I needed the same thing and just used the following code because of the AUTO_INCREMENT bug in mysql v3.23 when there is a -1 in that field :
$strQuery = "SELECT MAX(user_id) AS total FROM phpbb_users"; $result = mysql_query($strQuery); $row = mysql_fetch_row($result); $new_user_id = $row['total'] + 1; unset($result); unset($row);
Actually, the code is in profile.php. Just grep on 'v3.23' and you should find it.
Regards, -Fats MajorFatboy
|
|
External Registration
Yea I figured about the MAX() thingy only I wasn't sure either.. So I thought I'd ask first.
I'll check out that PHP file, thanks. DanceTrend
|
|
External Registration
Anyone?
I think I almost figured out how I must do it, only there's 1 thing.. The userid filed is not auto_increment, so I only need to now what query PhpBB uses to insert a new user in the database..
If I only get to know how the user id is inserted I know enough [for now ].... DanceTrend
|
|
External Registration
Without having looked at the code for a couple of months, I believe they run one query
SELECT MAX(user_id) FROM users
and then add 1 to the number they get to come up with the new userid. I could be wrong though.
Might want to look in the includes/usercp_register.php file since that is where the code is I believe. (Hint: look through the $mode = 'register' sections.) BG
|
|
- Source: - Previous Question: phpBB phpBB 3.0.x 3.0.x Support Forum - Next Question: SitePoint Forums General Chat |
|
|