Forums

PHP

This topic is locked

Additional Global Variables

Posted 01 Aug 2005 04:42:47
1
has voted
01 Aug 2005 04:42:47 Chris Trace posted:
Hey there,

I have extended the DMX login sql query to include a 4th table field in the hope of being able to return an additional $variable from the LoginRS protocol.

This didnt seem to work in establishing or reading the returned data succesfully into the new session variable.

Anyone know why?

Replies

Replied 01 Aug 2005 09:56:10
01 Aug 2005 09:56:10 Chris Trace replied:
mysql_select_db($database_mydatabase, $mydatabase);

$LoginRS__query=sprintf("SELECT username, userpassword, useraccess, userid FROM memberprimarydata WHERE username='%s' AND userpassword='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));

$LoginRS = mysql_query($LoginRS__query, $mydatabase) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {

$loginStrGroup = mysql_result($LoginRS,0,'useraccess');
$chablysid = mysql_result($LoginRS,0,'userid');


$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;
$GLOBALS['MM_Userid'] = $userid;

//register the session variables
session_register("MM_Username";
session_register("MM_UserGroup";
session_register("MM_Userid";

Reply to this topic