help this

Results 1 to 4 of 4
  1. #1
    Ahhh?? k0d0k is offline
    MemberRank
    Dec 2014 Join Date
    MARSLocation
    473Posts

    help this

    Warning: odbc_exec(): SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or function usp_CreateNewAccount has too many arguments specified., SQL state 37000 in SQLExecDirect in C:\xampp\htdocs\sites\regist.php on line 107

    regist account on website


  2. #2
    Owner raventh1984 is offline
    MemberRank
    May 2011 Join Date
    NetherlandsLocation
    1,499Posts

    Re: help this

    Just like it said. The stored Procedure has to many arguments then your ACCOUNT_TBL has on fields.

  3. #3
    Ahhh?? k0d0k is offline
    MemberRank
    Dec 2014 Join Date
    MARSLocation
    473Posts

    Re: help this

    Quote Originally Posted by raventh1984 View Post
    Just like it said. The stored Procedure has to many arguments then your ACCOUNT_TBL has on fields.
    can you fix this?

  4. #4
    Proficient Member Jerzkie is offline
    MemberRank
    Jul 2012 Join Date
    System32Location
    178Posts

    Re: help this

    Maybe this could help you :)

    Code:
    USE [ACCOUNT_DBF]
    GO
    /****** Object:  StoredProcedure [dbo].[usp_CreateNewAccount]    Script Date: 12/28/2014 14:11:31 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER proc [dbo].[usp_CreateNewAccount]
     @account varchar(32),
    @pw varchar(32),
     @Cash int = 0,
     @email varchar(100) = ''
    
    as
    set nocount on
    set xact_abort on
    
    if not exists (select * from ACCOUNT_TBL where account = @account)
    begin
    
    
    	begin tran
    	INSERT ACCOUNT_TBL(account,password,isuse,member,id_no1,id_no2,realname, cash, votepoints)
    	VALUES @account, @pw, 'T', 'A', '', '', '', @Cash)
    	INSERT ACCOUNT_TBL_DETAIL(account,gamecode,tester,m_chLoginAuthority,regdate,BlockTime,EndTime,WebTime,isuse,secession, email)
    	VALUES @account,'A000','2','F',GETDATE(),CONVERT(CHAR(8),GETDATE()-1,112),CONVERT(CHAR(8),DATEADD(year,10,GETDATE()),112),CONVERT(CHAR(8),GETDATE()-1,112),'T',NULL, @email)
    	insert AccountPlay (Account, PlayDate)
    	select @account, convert(int, convert(char(8), getdate(), 112))
    
    	if @@error <> 0
    	begin
    		rollback tran
    		select -1
    	end
    	else
    	begin
    		commit tran
    		select 1
    	end
    end
    else
    begin
    	select 0
    end



Advertisement