Jump to content

[SOLVED] phpbb auto increment question?


Solarpitch

Recommended Posts

Is anyone familiar with the way phpbb works in terms of adding a new user to the database. If i am right it doesnt seem to auto increment?

 

When a new user registers fir my site, I also have an sql insert into the phpbb_user table too so they can then logon to the forum.

 

But the id seems to go in as just 0 and wont increment! Is there any reason for this?

Link to comment
https://forums.phpfreaks.com/topic/56983-solved-phpbb-auto-increment-question/
Share on other sites

what you need to do it pull the highest value from the table and then increment it using ++ and it should work as i use something similar

 

<?php

$query = mysql_query("SELECT MAX(field1) AS `field1` FROM `table` WHERE field2='$var'") or die(mysql_error());
$fetch= mysql_fetch_assoc($query) or die(mysql_error());
$post_num = $fetch['field1'];
$post_num++;

?>

 

Hope it helps ;D

 

~ Chocopi

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.