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
ark) for all of your help.
O From Now 'Till Then,
\->Reginald Alex Mullin
/\ 212-894-1690
> -Original Message-
> From: Mullin, Reginald
> Sent: Monday, March 18, 2002 2:45 PM
> To: '[EMAIL PROTECTED]'
> Subject: FW: [PHP] Creating arrays using
On Tuesday 19 March 2002 03:44, Mullin, Reginald wrote:
> I've just added another record to the table. Now they're a total of 3
> records matching the "WHERE emp_id='$emp_login_id" criteria. When I
> "print_r(array_values($emp_login_grp_id));" I get the following values:
> Array ( [0] => 222 [1]
2["role_id"];
> $i++;
> }
> session_register('emp_login_wkgrp_id');
> session_register('emp_login_grp_id');
> session_register('emp_login_role_id');
> }
>
> O From Now 'Till Then,
> \-> Regi
>Reginald Alex Mullin
/\ 212-894-1690
> -Original Message-
> From: Mark Heintz PHP Mailing Lists [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, March 18, 2002 1:26 PM
> To: Mullin, Reginald
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Cre
You have to call mysql_fetch_array for each record in your result set...
$emp_login_wkgrp_id = array ();
$emp_login_grp_id = array ();
$emp_login_role_id = array ();
$i = 0;
while($employee_2 = mysql_fetch_array($result_2)){
$emp_login_wkgrp_id[$i] = $employee_2["wkgrp_id"];
$emp_login_grp_i
Hi Guys,
I've been experiencing some problems when trying to build 3 arrays with the
ID values of all of the groups a user belongs to. (I then want to register
these arrays into the current session). The arrays only appear to be
getting the first value (group ID) instead of all of the values th
7 matches
Mail list logo