ok i created a few db quarys that work perfect from deleating dp to adding db by userid and help from tyler got me a good item gift quary that gose by charname and item numbers now to my problem.. i execute this php with a index page that fills in item id account id and charname and count it all activates perfect here is the script
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>";}
?>
and here is outcome
Code:
points deducted admin 200
The item was Baught successfully.
User: DASH
Item: 1001
Count: 1
Account: admin
Points deducted: 200
now problem even tho it al looks good is when you check the db the points were not actyaly deducted any idea what i can do to creat the php script
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.