foreach

Posts 14 of 4 · Page 1 of 1
hey

which of these is correct:

1)
[html]if ((isset($_POST['del'])) && $_POST['pergjigje1'] && $_POST['pergjigje2'])
{
$d = 0;
$nd = 0;
foreach ($_POST['pergjigje1'] as $questionid && $_POST['pergjigje2'] as $aid)
{
$sql = "DELETE FROM `enco`.`forum_answer` WHERE question_id = '$questionid' AND a_id = '$aid'";
if (mysql_query($sql) && mysql_affected_rows()) $d++;
else $nd++;


}

$msg = "Vepra eshte fshire!";
if($nd) $err = "$nd Vepra nuk eshte fshire!";
echo "<b>Pergjigja e temes se forumit eshte fshire!</b><br />";
} [/html]

or

2)
[html]if ((isset($_POST['del'])) && $_POST['pergjigje1'] && $_POST['pergjigje2'])
{
$d = 0;
$nd = 0;
foreach ($_POST['pergjigje1'] as $questionid AND $_POST['pergjigje2'] as $aid)
{
$sql = "DELETE FROM `enco`.`forum_answer` WHERE question_id = '$questionid' AND a_id = '$aid'";
if (mysql_query($sql) && mysql_affected_rows()) $d++;
else $nd++;


}

$msg = "Vepra eshte fshire!";
if($nd) $err = "$nd Vepra nuk eshte fshire!";
echo "<b>Pergjigja e temes se forumit eshte fshire!</b><br />";
} [/html]



please answer as soon as possible this is urgent!!!


bump bump urgent

bump bump urgentbump bump urbump bubbump bump urgentump bump urgentmp urgentgent
Neither of them are correct!
yea true, this is the place for this kinda shit. uhuh. yes. please post more codes yes please.
Foreign language I dont understand..LOL
Posts 14 of 4 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?