I have decided to release a procedure that will load Gift Silk when a player registers.
this was created to work with most php registration pages and has worked great on a test server i was using it on.
here is the php code that must be input into the reg page
The bold red if for database info and the blue is for the Username
post field name.
Here is the stored procedure used with this php script
to keep from having people using google chrome to set there own amount of silk when they register make sure to only edit the GiftAmount in the stored procedure with the amount you want new accounts to have.
i hope this is useful for people and enjoy.
this was created to work with most php registration pages and has worked great on a test server i was using it on.
here is the php code that must be input into the reg page
Code:
$serverName = "[COLOR=Red][U][B]DBServername[/B][/U][/COLOR]";
$connectionInfo = array("UID"=>"[COLOR=Red][U][B]DBUSER[/B][/U][/COLOR]", "PWD"=>"[COLOR=Red][U][B]DBPASS[/B][/U][/COLOR]", "Database"=>"SRO_VT_ACCOUNT");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
echo "Could not connect.\n";
die( print_r( sqlsrv_errors(), true));
}
/* Set up and execute the query. */
$sql = "SELECT JID
FROM TB_User
WHERE StrUserID='$[COLOR=Blue][U][B]USERNAME[/B][/U][/COLOR]'";
$stmt = sqlsrv_query( $conn, $sql);
if( $stmt === false ) {
die( print_r( sqlsrv_errors(), true));
}
if( sqlsrv_fetch( $stmt ) === false) {
die( print_r( sqlsrv_errors(), true));
}
$jid = sqlsrv_get_field( $stmt, 0);
$addsilk = "exec _RegSilk '$jid', 0, 0, 0";
sqlsrv_query($conn, $addsilk);
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
post field name.
Here is the stored procedure used with this php script
Code:
USE [SRO_VT_ACCOUNT]
GO
/****** Object: StoredProcedure [dbo].[_RegSilk] Script Date: 01/03/2012 23:54:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[_RegSilk]
@JID int,
@silk_own int,
@silk_gift int,
@silk_point int
as
insert SK_Silk (JID, silk_own, silk_gift, silk_Point)
values (@JID, 0, [COLOR=Red][U][B]GiftAmount[/B][/U][/COLOR], 0)
i hope this is useful for people and enjoy.