DANGER, WATCH OUT!
Using the superglobal $_SESSION array with DB queries is dangerous. EG:
mysql_query("select foo from bar where username='$_SESSION['username']'");
TOO MANY QUOTES!
Instead:
$q = "select foo from bar where username='".$_SESSION['username']."'";
mysql_query($q);
But, then...you probably knew that already.
----
Manual Page -- http://www.php.net/manual/en/ref.session.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33555
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33555&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33555&report=yes
Note Submitter: tomhunter@no-spam
----
DANGER, WATCH OUT!
Using the superglobal $_SESSION array with DB queries is dangerous. EG:
mysql_query("select foo from bar where username='$_SESSION['username']'");
TOO MANY QUOTES!
Instead:
$q = "select foo from bar where username='".$_SESSION['username']."'";
mysql_query($q);
But, then...you probably knew that already.