sql delete from foreach function
Posted: Sat Jun 30, 2012 5:58 pm
hi guys.. masters... i have this problem deleting more than 1 record. my desired outcome should be:
mysql_query("DELETE FROM employee WHERE emp_id IN (2,5)");
2 and 5 are from foreach function ....
is this possible?
mysql_query("DELETE FROM employee WHERE emp_id IN (" .
foreach ($values as $a)
{
$a;
--$counter;
if ($counter != 0)
{ . ',' . ; }
else { .')'. ; }} );
it wont work... im been working on this for 2 days... whew.. my brain aches... i just want to get the value from an array so i suppose to use foreach function for that and put it on the delete query but it wont work... please help... thank you in advance
mysql_query("DELETE FROM employee WHERE emp_id IN (2,5)");
2 and 5 are from foreach function ....
is this possible?
mysql_query("DELETE FROM employee WHERE emp_id IN (" .
foreach ($values as $a)
{
$a;
--$counter;
if ($counter != 0)
{ . ',' . ; }
else { .')'. ; }} );
it wont work... im been working on this for 2 days... whew.. my brain aches... i just want to get the value from an array so i suppose to use foreach function for that and put it on the delete query but it wont work... please help... thank you in advance