Newbie Spellweaver
- Joined
- Feb 17, 2015
- Messages
- 5
- Reaction score
- 1
Hello, I have the registration script from here : http://forum.ragezone.com/f853/simple-php-register-script-1049880/ and it's working fine !
(PHP script of this release
I have this MSSQL query which is working fine :
Please, help me I tryed many things and I searched for hours but nothing worked
I tryed to add this :
So how to add 100000 Cash Points at registration with the MSSQL query or in anyway ?
Thanks by advance for you help !
(PHP script of this release
The only problem i have is that i want to add 100000 cash points to the account at registration.. And I don't know how to do so..<?php$serverName = "XXXXX\SQLEXPRESS"; //serverName\instanceName$connectionInfo = array( "Database"=>"dnmembership", "UID"=>"XX", "PWD"=>"XX");$conn = sqlsrv_connect( $serverName, $connectionInfo);
if($conn) {
//do nothing here. }else{ echo "Connection could not be established.<br />"; die( print_r( sqlsrv_errors(), true));}
if($_POST['submit']) // checks to see if the player has pressed submit to get to this page.{ //gather the submitted details and clean it using stripslashes $Username = stripslashes($_POST['username']); $Password = stripslashes($_POST['password']); $PasswordConfirm = stripslashes($_POST['confirmpassword']);
//FOR EXTRA SECURITY mysql_real_escape_string($Username); mysql_real_escape_string($Password); mysql_real_escape_string($PasswordConfirm); if($PasswordConfirm !=$Password){ echo("The passwords do not match.");} if((!$Password) || (!$PasswordConfirm)){ echo("Please re enter your information.");} else{ sqlsrv_query($conn, "INSERT INTO dnmembership.dbo.Accounts (AccountName, AccountLevelCode, GameOption, CharacterCreateLimit, LastCharacterCreateDate, CharacterMaxCount, LastLoginDate, LastLogoutDate, LastLoginIP, LastSessionID, JoinIP, RegisterDate, PublisherCode, GenderCode, BirthDate, Passphrase, NationalityCode, ChannelPartnerCode, NewbieRewardFlag,SecondAuthLockFlag)VALUES ('$Username','0', NULL,'4', NULL,'4', null, NULL, null,null, null, GETDATE(), '4', null,null, (SELECT HashBytes('MD5','$Password')), null, NULL,'true', CAST(0 AS bit))") or die("That account already exists, try a different username.");
echo("Your account has been created, have fun !"); }}else{ echo("Access to this page has been denied.");}
?>
I have this MSSQL query which is working fine :
Maybe it should be implemented inside the registration code of the release ?USE [DNMembership]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[P_ModCashBalance]
@nvcAccountName = N'USERNAME', @IntCashBalance = 100000
SELECT 'Return Value' = @return_value
GO
Please, help me I tryed many things and I searched for hours but nothing worked
I tryed to add this :
But it doesnt work with AccountName since the table hasnt this section inside.. Or maybe is there a way to replace it ?sqlsrv_query($conn, "INSERT INTO dnmembership.dbo.CashIncome (AccountID, CashIncomeCode, PGCode, PGKey, CashAmount, IncomeDate)VALUES ('$Username','2', NULL, NULL, '100000', GETDATE())") or die("Add cash error.");
So how to add 100000 Cash Points at registration with the MSSQL query or in anyway ?
Thanks by advance for you help !
Last edited: