Create and Alter For WebShop

Results 1 to 9 of 9
  1. #1
    Proficient Member bsitmark is offline
    MemberRank
    Sep 2012 Join Date
    166Posts

    Create and Alter For WebShop

    Last edited by bsitmark; 25-02-13 at 09:12 AM. Reason: Update


  2. #2
    Account Upgraded | Title Enabled! Onplay is offline
    MemberRank
    Jun 2012 Join Date
    495Posts

    Re: Create and Alter For WebShop

    why my database not have db usp_GetUserCash and db dbo.usp_SetUserCash ???

    need create manual or already have after do it query ..... cos i have some error

    OR can syer already fix cabalshop ep8 folder

    thnks

  3. #3
    Proficient Member bsitmark is offline
    MemberRank
    Sep 2012 Join Date
    166Posts

    Re: Create and Alter For WebShop

    just at go at the bottom of the new query

    ex.
    COMMIT TRAN
    END

    GO

  4. #4
    Valued Member dosimple is offline
    MemberRank
    Jun 2008 Join Date
    104Posts

    Re: Create and Alter For WebShop

    why i can't add new item, Warning: mssql_query() [function.mssql-query]: message: Column name or number of supplied values does not match table definition. (severity 16) in C:\xampp\htdocs\xxxxxx\admin.php on line 135, Warning: mssql_query() [function.mssql-query]: Query failed in C:\xampp\htdocs\xxxxxx\admin.php on line 135

    i do check on admin.php line135 has to be modify with something
    Code:
      $r=mssql_query('insert into '.DB_CSH.'.dbo.ShopItems values ("'.$iname.'","'.$idesc.'","'.$iidx.'","'.$idur.'","'.$iopt.'","'.$iimage.'",0,"'.$ialz.'","'.$icat.'","'.$iavail.'")');
      echo '<div align="center"><a href="admin.php?v1='.$v1.'&v2='.$v2.'&">Done</a></div>';
    }

  5. #5
    Valued Member Tmxx Rush is offline
    MemberRank
    Nov 2012 Join Date
    in the darknessLocation
    139Posts

    Re: Create and Alter For WebShop

    For me wont connect to getcash i try it like 10 hour ago :( I get all details edited but somewhere always fuk up :((
    For xamp even dont work :(
    Warning: mssql_query() [function.mssql-query]: message: Could not find stored procedure 'CabalCashdbo.usp_GetUserCash'. (severity 16) in C:\wamp\www\webshop.php on line 41

    Warning: mssql_query() [function.mssql-query]: Query failed in C:\wamp\www\webshop.php on line 41

    Warning: mssql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\webshop.php on line 42
    this the row... :(
    $r=mssql_query("exec ".DB_CSH."dbo.usp_GetUserCash '".$_SESSION['v1']."','".$newbalz."'");

  6. #6

    Re: Create and Alter For WebShop

    i got this error :

    Code:
    Warning: mssql_query() [function.mssql-query]: message: Cannot insert the value NULL into column 'UpdateDateTime', table 'CabalCash.dbo.CashAccount'; column does not allow nulls. INSERT fails. (severity 16) in C:\xampp\htdocs\Cabal\account.php on line 24
    
    Warning: mssql_query() [function.mssql-query]: Query failed in C:\xampp\htdocs\Cabal\account.php on line 24
    
    Warning: mssql_fetch_row() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Cabal\account.php on line 25

  7. #7
    █║▌║▌║TheMerc iful║▌║▌║█ 4pLay is offline
    MemberRank
    Jan 2005 Join Date
    DXBLocation
    1,444Posts

    Re: Create and Alter For WebShop

    Quote Originally Posted by bsitmark View Post
    ReWork 02/25/2013
    I Create and Alter the dbo of getbank and setbank to usp_GetUserCash and usp_SetUserCash

    because i noticed that there already shopitems at cashcabal and also we should use the cash from cashcabal not alz

    usp_GetUserCash
    Code:
    USE [CabalCash]
    GO
    /****** Object:  StoredProcedure [dbo].[usp_GetUserCash]    Script Date: 02/15/2013 19:32:52 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    
    
    
    
    ALTER   proc [dbo].[usp_GetUserCash]
    @usernum INT
    AS
    BEGIN
    	if ( SELECT UserNum FROM CashAccount WHERE UserNum = @UserNum ) is Null 
    	BEGIN
    		INSERT CashAccount ( UserNum, Cash, CashBonus, UpdateDateTime )
    		VALUES( @UserNum, 0, 0, null)
    	END
    	SELECT UserNum, Cash, CashBonus, CashTotal, UpdateDateTime
    	FROM CashAccount
    	WHERE UserNum = @UserNum
    END
    dbo.usp_SetUserCash
    Code:
    USE [CabalCash]
    GO
    /****** Object:  StoredProcedure [dbo].[usp_SetUserCash]    Script Date: 02/15/2013 19:31:41 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    
    CREATE PROCEDURE [dbo].[usp_SetUserCash]( @UserNum int, @Cash int) 
    AS
    BEGIN
    BEGIN TRAN
    	IF NOT EXISTS( SELECT UserNum
    		FROM CashAccount
    		WHERE UserNum = @UserNum )
    	BEGIN
    		INSERT CCashAccount (UserNum, Cash)
    		VALUES ( @UserNum, 0)
    	END
    	ELSE
    	BEGIN
    		UPDATE CashAccount
    		SET Cash = @Cash
    		WHERE UserNum = @UserNum
    	END
    COMMIT TRAN	
    END
    and edit config.php
    Code:
    // In case you have a different db names
    define('DB_ACC','ACCOUNT');
    define('DB_GAM','SERVER01');
    define('DB_CCA','CABALCASH');
    define('DB_CSH','CABALCASH');
    and edit the account.php, buy.php, webshop.php change the setbank and getbank to usp_getusercash and usp_setusercash

    for webshop link For Ep8
    this webshop i didnt made it. chump made it and revised by codehavok

    i hope this would help some newbie too..


    If anyone could correct me im really thankful
    Just Tried This Out... And...

    I Gotta Bitch About This Error... Followed Your Mini Tut...

    And Got This Error...




  8. #8
    Proficient Member bsitmark is offline
    MemberRank
    Sep 2012 Join Date
    166Posts

    Re: Create and Alter For WebShop

    nvm this, i will rework that webshop after i finish the web i've been working of

  9. #9
    █║▌║▌║TheMerc iful║▌║▌║█ 4pLay is offline
    MemberRank
    Jan 2005 Join Date
    DXBLocation
    1,444Posts

    Re: Create and Alter For WebShop

    Quote Originally Posted by bsitmark View Post
    nvm this, i will rework that webshop after i finish the web i've been working of
    Oki Doki! And Which Web Is This That You Are Workin' On?!...

    So, I Guess Back To ALZ Then...



Advertisement