Code:
<?php
$CharName = trim($_POST['CharName']);
$ItemID = trim ($_POST['ItemID']);
$Count = trim ($_POST['Count']);
$UserID = trim($_POST['UserID']);
// Connection with MSSQL server
$conn=mssql_connect('xxx','xxx','xxx');
$db = mssql_select_db('PS_UserData',$conn) or die("MSSQL Conection Error!");
$res = mssql_query("SELECT UserID FROM PS_UserData.dbo.Users_Master WHERE (UserID) = ('".$UserID."')");
if (mssql_num_rows($res))
// Insert Start
{
if($ItemID = "1001" and $count = "1")
$Points="200";}
$query1 = "exec PS_GMTool.dbo.usp_DeleatePoints' ".$UserID."','".$Points."'";
$rresult1 = mssql_query($query1) or die("Create GameAccountTBL Error!");
{echo "points deducted $UserID $Points";}
$query2 = "exec PS_GMTool.dbo.usp_GiftBox '".$CharName."','".$ItemID."','".$Count."'";
$rresult1 = mssql_query($query2) or die("Create GameAccountTBL Error!");
{echo "The item was Baught successfully.<br /><br /><b>User:</b> $CharName<br><b>Item:</b> $ItemID<br><b>Count:</b> $Count <br><b>Account:</b> $UserID<br> <b>Points deducted:</b> $Points<br>";}
?>
Code:
points deducted admin 200 The item was Baught successfully. User: DASH Item: 1001 Count: 1 Account: admin Points deducted: 200
actyaly take the value in the count table and turn it into the $Points value or am i doing it corect and its just not inputing the corect info in corect spots to deduct the points or anything else i may have messed up or missed.






