I should have been more exact in my original reply.  The second query
isn't necessary.  Try this:

File: login.php
# if $employee_1, query db workgroups table to check if $emp_login_id
belongs to any groups
$sql_2 = "SELECT * FROM workgroups WHERE emp_id='$emp_login_id'";
$result_2 = @mysql_query($sql_2) or die (mysql_error());
# initialize empty arrays
$emp_login_wkgrp_id = array();
$emp_login_grp_id = array();
$emp_login_role_id = array();
$i=0;
# while there are matches, set workgroups login variables in array, then
# register workgroups login variables in session
while($employee_2 = mysql_fetch_array($result_2)){
  $emp_login_wkgrp_id[$i] = $employee_2["wkgrp_id"];
  $emp_login_grp_id[$i] = $employee_2["grp_id"];
  $emp_login_role_id[$i] = $employee_2["role_id"];
  $i++;
}
session_register('emp_login_wkgrp_id');
session_register('emp_login_grp_id');
session_register('emp_login_role_id');


mh


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to