Demonicman
03-02-2007, 11:45 PM
<?php
//no Mysql info for you :)
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{
function mySum($numX, $numY){
$total = $numX + $numY;
return $total;
}
$newpoints = $info['points'];
echo "Before now, your points were = ". $newpoints ."<br />";
// Store the result of mySum in $newpoints
$newpoints = mySum($info['points'], 1);
echo "After now, your points are = " . $newpoints ."<br />";
mysql_query("UPDATE users SET points='$newpoints' WHERE points='$info[\'points\']' ")
or die(mysql_error());
}
?>
<a href="account.php">Continue?</a>
Now i bet your wondering why i posted this here... well...
Parse error: parse error, unexpected T_BAD_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\wamp\www\account\addpoints.php on line 21
//no Mysql info for you :)
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{
function mySum($numX, $numY){
$total = $numX + $numY;
return $total;
}
$newpoints = $info['points'];
echo "Before now, your points were = ". $newpoints ."<br />";
// Store the result of mySum in $newpoints
$newpoints = mySum($info['points'], 1);
echo "After now, your points are = " . $newpoints ."<br />";
mysql_query("UPDATE users SET points='$newpoints' WHERE points='$info[\'points\']' ")
or die(mysql_error());
}
?>
<a href="account.php">Continue?</a>
Now i bet your wondering why i posted this here... well...
Parse error: parse error, unexpected T_BAD_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\wamp\www\account\addpoints.php on line 21