[SOLVED] $_SESSION Problem!!!
Posted: Sat Mar 13, 2004 10:54 am
Recently I have been trying to create a points system for my site where users can gain points to their account by completing challenges. I am trying to update their current score by using a SESSION which holds their username. When I try to add 25 points to the account I get an error. The code go's like:
if ($app1 == "pass")
$link = mysql_connect("???", "???", "???");
mysql_select_db("???") or die("couldnt connect" . mysql_error());
$sql = "SELECT points FROM members WHERE SesID = $_SESSION['username']";
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result))
{
$row = mysql_fetch_assoc($result);
mysql_query("INSERT INTO members ('points') VALUES(points + 25"));
mysql_close($link);
}
Can anyone please help me with this problem??
Regards
Joe
if ($app1 == "pass")
$link = mysql_connect("???", "???", "???");
mysql_select_db("???") or die("couldnt connect" . mysql_error());
$sql = "SELECT points FROM members WHERE SesID = $_SESSION['username']";
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result))
{
$row = mysql_fetch_assoc($result);
mysql_query("INSERT INTO members ('points') VALUES(points + 25"));
mysql_close($link);
}
Can anyone please help me with this problem??
Regards
Joe