[Discussion]My [Auth] and [INSERT Query]!

08/13/2014 17:01 mohamad512#1
Hello every body !!

I was have a prb in my register script but I ... it any way I have seen allot of reg scripts !! and all of it !!

the query like that :
PHP Code:
"INSERT Accounts( login_name,password,block,withdraw_remain_time,age ,auth_ok,pcbang,last_login_server_idx,event_code,result,ip,email) VALUES('$user','$converted_password',0,0,18,1,0,1,0,1,0,0)"
But my Auth Different WHAY ??!! and all of u the same or just me !!

[Only registered and activated users can see links. Click Here To Register...]
08/13/2014 17:42 c1ph3r#2
Can you please start using the helpthread. There are two different auth databases which has been discussed several times!
08/13/2014 18:19 mohamad512#3
first of all !! I'm sorry for not using Help Thread !! But no one @@ even lock at the tread !!

and way ^^ !!

can u give me the another auth ? ^ :)
08/13/2014 18:51 ThunderNikk#4
One auth account table is old, the other auth account table is new...

One works with older server files and one works with the newer server files clients and sframes.

Wouldn't you want to continue using the one that works with your server files?

The registration script was written for another account table...rewrite the script don't change the auth account table.
08/13/2014 18:53 mohamad512#5
ok my friend but how can i deal with account_id ^^ ?

I rewrite it ^ is it right ?
PHP Code:
INSERT INTO [Auth].[dbo].[Account] ( account_id,account,password,email,pk_ ,creationDate_,updateDate_,creatorId_,updatorId_,portId_,type_,accessDate_,password2 VALUES('','$username','$converted_password','$email','1','','','','','','com.elixir.billing.impl.ImmAccount','','$Apassword2')"; 
08/13/2014 19:00 ThunderNikk#6
Thought you said you fixed it already/

But yes just rewrite the script to match your table column names.

There will probably be more in the script that will have to be rewritten though than just the SQL insert querry.

You will need to rewrite portions of the registration script that generate those column values.
08/13/2014 19:20 mohamad512#7
You will need to rewrite portions of the registration script that generate those column values

I DON'T NOW HOW TO DO THAT

THE ERROR always show up @@' the $conn is connected !!
but the prob in $sql !!

it seems right !

PHP Code:
if(count($errors) == 0){
    
        
$sql "INSERT INTO [Auth].[dbo].[Account] ( account_id,account,password,email,pk_ ,creationDate_,updateDate_,creatorId_,updatorId_,portId_,type_,accessDate_,password2 ) VALUES('','$username','$password','$email','1','NULL','NULL','NULL','NULL','NULL','com.elixir.billing.impl.ImmAccount','NULL','$password2')";
        
        if(
$result odbc_exec($conn,$sql)){
            
$success "Account Successfully Created!";
        }else{
            
            
$errors[] = '<font size ="4"><font color="red"><center>SONTHING WRONG</center></font></size>';
        }
    }

08/13/2014 21:19 ThunderNikk#8
I am sorry I am not very well versed in PHP...my registration script is the one ismokedrow wrote for ASPX

If you really want me to figure out what is going on with the PHP I am going to need to see the entire script not just the insert SQL query.

"THE ERROR always show up @@' the $conn is connected !!"

Sounds like you have some syntax issues to me.
08/13/2014 21:22 mohamad512#9
ok do u have skype ?

add me mohamad512-aboatallah
08/13/2014 22:53 ThunderNikk#10
Sorry I don't have a public skype.
08/14/2014 07:21 Musta²#11
Mate, you don't need to force people into looking into your problems to solve them, there's a dedicated thread for that and there are alot of experienced people who have dedicated a part of their time to help people in that manner.

Anyways, I'm answering you with the hope that this will be the last help thread by you, and here are the two ways you can solve this problem with:

1. Make a select sub-query inside your insert query to include a special account_id like this:
Code:
DECLARE @account_id int set @account_id = (SELECT MAX(account_id) FROM Account) INSERT INTO [Auth].[dbo].[Account] ( account_id,account,password,email,pk_ ,creationDate_,updateDate_,creatorId_,updatorId_,portId_,type_,accessDate_,password2 ) VALUES((@account_id)+1,'$username','$password','$email','1','NULL','NULL','NULL','NULL','NULL','com.elixir.billing.impl.ImmAccount','NULL','$password2')
2. Go to the Account table, right click it and click Design. Select the 'account_id' column, then on the bottom, change 'Identity Specification' to 'Yes'. This will allow the column to be auto-calculated as a unique identity such as the old accounts table.

And as I've mentioned above, please stop spamming the general forums with questions when there is a special thread for that.
08/14/2014 08:53 mohamad512#12
Done my friend But for the Change pass script :

This is wrong can u tell me the right insert query ?! :

PHP Code:
SELECT From [Auth].[dbo].[AccountWHERE account '$username' And Password '$Password'") or die('Failed to verify is the provided user named already exists.'); 
08/14/2014 10:53 Musta²#13
Quote:
Originally Posted by mohamad512 View Post
Done my friend But for the Change pass script :

This is wrong can u tell me the right insert query ?! :

PHP Code:
SELECT From [Auth].[dbo].[AccountWHERE account '$username' And Password '$Password'") or die('Failed to verify is the provided user named already exists.'); 
You can use an alternative method:

PHP Code:
$exists "SELECT COUNT(*) FROM Auth.dbo.Account WHERE account = '$username' AND password = '$password'";
if (
$exists "1") {
  echo 
"Failed to verify is the provided user named already exists.";
} else {
  echo 
"This account exists, do something here...";

I don't know php that well, but it should look something similar to this.
08/14/2014 12:34 mohamad512#14
Thanks man and chek ur WhatsApp -،-
08/14/2014 15:38 MrStubborn#15
done ?