Hello, I want to get referrer (it's account_id) from accounts and use it in next query
I have:
And it does not work. How can I get value and use in another query?
Btw I must use this syntax, "$variable = $SQL->query ( ... ) -> fetch();" will not work here
I have:
Code:
$accountID = $_REQUEST['custom']; // user account ID
$ref2 = "SELECT `referrer` FROM `accounts` WHERE `accounts`.`id`= '".mysql_real_escape_string($accountID)."';";
mysql_query($ref2);
$sqltest = "UPDATE `accounts` SET `premium_points` = `premium_points`+ 10 WHERE `accounts`.`id` = '".mysql_real_escape_string($ref2)."' ";
mysql_query($sqltest);
And it does not work. How can I get value and use in another query?
Btw I must use this syntax, "$variable = $SQL->query ( ... ) -> fetch();" will not work here