This topic is locked

How to pass the login details to the Before edit event???

7/15/2007 19:10:07
PHPRunner General questions
C
chaz author
global $conn,$strTableName;

$rs = db_query("select * from ".$strTableName." where ".$where,$conn);

$data = db_fetch_array($rs);
$strSQLExists = "select * from characters where guid='$data["leaderguid"]'";

$rsExists = db_query($strSQLExists,$conn);

$data1=db_fetch_array($rsExists);

if($data1["acct"]==?????????????????????????????????????)

{

// if record exists do something

return true;

}


the logon table is accounts.acct

  1. accounts.acct
  2. characters.acct, characters.guid

    2 guilds.leaderguid

Alexey admin 7/16/2007

chaz,
the username of currently logged user is stored in $_SESSION["UserID"] variable.

if($data1["acct"]==$_SESSION["UserID"])

...

C
chaz author 7/16/2007

the acct is a number unfortunately....
why wont $_SESSION["OwnerID"] work??

J
Jane 7/16/2007

You can also use $_SESSION["OwnerID"].

C
chaz author 7/16/2007

You can also use $_SESSION["OwnerID"].


well this isnt working for me....do i have re declare it??? also i am allowing everyone to see and edit in the security section coz the tables dont align