[SOLVED] $_SESSION["UserID"] and code snippets |
8/12/2010 3:35:20 PM |
PHPRunner General questions | |
K
kkiboo author
I am trying to create a code snippet that tells the logged in user how many rows they have created. $str = "select count(*) from Table where person=$_SESSION["UserID"]";
|
|
A
|
ann 8/13/2010 |
Hi, $str = "select count(*) as cnt from Table where person=". $_SESSION["UserID"]; |
K
|
kkiboo author 8/13/2010 |
Hi, here is the correct syntax for the code: $str = "select count(*) as cnt from Table where person=". $_SESSION["UserID"];
|
A
|
ann 8/13/2010 |
Hi, $str = "select count(*) as cnt from Table where person='". $_SESSION["UserID"]."'"; |
K
|
kkiboo author 8/13/2010 |
Thanks; For some reason, it still wasn't working, but I took out the "as cnt" part to return it back to just count(*) and .$data["COUNT(*)"] and it works just fine now. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=51858&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> |