MySQL query + PHP : Warning: implode() [function.implode]: Bad arguments : What's wrong here?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have 2 tables employees & transactions. 'employees' carry info about the 
employees and transactions carry there payslip info for each period.
I am trying to display a list of employees that don't have transactions in 
the current ($pp_id) period,
thus doing an array of the $emp_ids, having transactions in the current 
period
in order to exclude them in the next query.
I am using MySQL 4.1.11
Any help will be appreciated.

$pp_id = $_GET['pp_id'];
$t1 = "employees";
$t2 = "transactions";
$query = mysql_query("SELECT  `emp_id` FROM $t2 WHERE `pp_id` = '$pp_id'");
while ($row = @mysql_fetch_array($query))    {
    $emp_ids=$row['emp_id'];
    }

line 83:    $select_employee_query = mysql_query(" SELECT $t1.* FROM $t1 
WHERE emp_id IN (" . implode(', ', $emp_ids) . ") ");
               while ($row = @mysql_fetch_array($select_employee_query)) 
{
                    $var3=$row['emp_num'];
                    $var4=$row['emp_title'];
                    $var5=$row['emp_initials'];
                    $var6=$row['emp_surname'];

                    echo "$var3 $var4 $var5 $var6";
                    }

  Warning: implode() [function.implode]: Bad arguments. in 
../add_payslip1.php on line 83
 

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux