Hello Guys,
here a small tip to fix the registration with using my registration script ;)
Open your SQL Server Enterprise Manager , go to the Database account , search table Tbl_user and USER_PROFILE , make a right click on it and click to Design Table.
Edit the Data Type of user_no to int and NOT allowed nulls, and set primary key on it.
change Identity to Yes and save the tables.
close Enterprise Manager.
Open now the mssql_register.php and search this :
PHP Code:
$result = mssql_query("SELECT user_no FROM account.dbo.USER_PROFILE ORDER BY user_no DESC",$con);
$row = mssql_fetch_row($result);
$row[0] = $row[0]+1;
and Delete it , now search :
PHP Code:
mssql_query("INSERT INTO account.dbo.USER_PROFILE (user_no,user_id,user_pwd,resident_no,user_type,login_flag,login_tag,ipt_time,login_time,logout_time,user_ip_addr,server_id) VALUES ('".$row[0]."','".$_POST['accname']."','".$accpass."','801011000000','1','0','Y','".$date."',null,null,null,'000')",$con);
mssql_query("INSERT INTO account.dbo.Tbl_user (user_no,user_id,user_pwd,user_mail,user_answer,user_question) VALUES ('".$row[0]."','".$_POST['accname']."','".$_POST['accpass1']."','".$_POST['accmail']."','".$_POST['accquest']."','".$_POST['accansw']."')",$con);
and edit it to :
PHP Code:
mssql_query("INSERT INTO account.dbo.USER_PROFILE (user_id,user_pwd,resident_no,user_type,login_flag,login_tag,ipt_time,login_time,logout_time,user_ip_addr,server_id) VALUES ('".$_POST['accname']."','".$accpass."','801011000000','1','0','Y','".$date."',null,null,null,'000')",$con);
mssql_query("INSERT INTO account.dbo.Tbl_user (user_id,user_pwd,user_mail,user_answer,user_question) VALUES ('".$_POST['accname']."','".$_POST['accpass1']."','".$_POST['accmail']."','".$_POST['accquest']."','".$_POST['accansw']."')",$con);
Save it and ready.
For ODBC :
Search this :
PHP Code:
$result = odbc_exec($odbc_acc_con,"SELECT user_no FROM account.dbo.USER_PROFILE ORDER BY user_no DESC");
$row = odbc_result($result,1);
$row = $row+1;
and delete it.
now search this :
PHP Code:
odbc_exec($odbc_acc_con,"INSERT INTO account.dbo.USER_PROFILE (user_no,user_id,user_pwd,resident_no,user_type,login_flag,login_tag,ipt_time,login_time,logout_time,user_ip_addr,server_id) VALUES ('".$row."','".$_POST['accname']."','".$accpass."','0','1','0','Y',null,null,null,null,'000')");
odbc_exec($odbc_acc_con,"INSERT INTO account.dbo.Tbl_user (user_no,user_id,user_pwd,user_mail,user_answer,user_question) VALUES ('".$row."','".$_POST['accname']."','".$_POST['accpass1']."','".$_POST['accmail']."','".$_POST['accquest']."','".$_POST['accansw']."')");
and edit it to :
PHP Code:
odbc_exec($odbc_acc_con,"INSERT INTO account.dbo.USER_PROFILE (user_id,user_pwd,resident_no,user_type,login_flag,login_tag,ipt_time,login_time,logout_time,user_ip_addr,server_id) VALUES ('".$_POST['accname']."','".$accpass."','0','1','0','Y',null,null,null,null,'000')");
odbc_exec($odbc_acc_con,"INSERT INTO account.dbo.Tbl_user (user_id,user_pwd,user_mail,user_answer,user_question) VALUES ('".$_POST['accname']."','".$_POST['accpass1']."','".$_POST['accmail']."','".$_POST['accquest']."','".$_POST['accansw']."')");
Save and ready.
You will no more have problems with two and more double user_no's
;)