Dit is een deel de broncode:
<KNIP>
while ($mycol = mysql_fetch_array($result)){
if ($i<=3) {
$index = $mycol["0"];
$naam = $mycol["1"];
$ondert = $mycol["2"];
$prijs = $mycol["3"];
$afmeting = $mycol["4"];
$orient = $mycol["5"];
$gallery = $mycol["6"];
$plaatje = $mycol["7"];
echo "<td height=160 width=200 align=center>\n";
echo "[img]\"$gallery\\th_$plaatje\"><BR[/img]\n";
echo "$orient\n";
if ($orient=1) {
echo "<A href=\"JavaScript:popup('popup.php?doorgeef=$index', 550, 450);\">$naam</a><BR>\n";
} else {
echo "<A href=\"JavaScript:popup('popup.php?doorgeef=$index', 400, 500);\">$naam</a><BR>\n";
}
echo "Afmeting: $afmeting cm<BR>\n";
echo "Prijs: $prijs<BR>\n";
echo "<A href=\"bestel.php?doorgeef=$index\">Bestel</a></TD>\n";
$i=$i+1;
} else {
echo "</tr>\n";
echo "<tr>\n";
$i=1;
}
}
<KNIP>
De eerste IF werkt perfect ( if ($i<=3) { etc. ) probleem is dat de 2e IF ( if ($orient="1") { etc. ) niet werkt. Standaard wordt altijd de eerste optie gekozen en ook al is $orient 2 (check ik door dump op scherm ( echo "$orient\n"; ) dan nog kiest hij voor de eerste keuze.
In de tabel":
Orientatie int(1) NOT NULL default '1',
Wat doet deze n00b fout ?
<KNIP>
while ($mycol = mysql_fetch_array($result)){
if ($i<=3) {
$index = $mycol["0"];
$naam = $mycol["1"];
$ondert = $mycol["2"];
$prijs = $mycol["3"];
$afmeting = $mycol["4"];
$orient = $mycol["5"];
$gallery = $mycol["6"];
$plaatje = $mycol["7"];
echo "<td height=160 width=200 align=center>\n";
echo "[img]\"$gallery\\th_$plaatje\"><BR[/img]\n";
echo "$orient\n";
if ($orient=1) {
echo "<A href=\"JavaScript:popup('popup.php?doorgeef=$index', 550, 450);\">$naam</a><BR>\n";
} else {
echo "<A href=\"JavaScript:popup('popup.php?doorgeef=$index', 400, 500);\">$naam</a><BR>\n";
}
echo "Afmeting: $afmeting cm<BR>\n";
echo "Prijs: $prijs<BR>\n";
echo "<A href=\"bestel.php?doorgeef=$index\">Bestel</a></TD>\n";
$i=$i+1;
} else {
echo "</tr>\n";
echo "<tr>\n";
$i=1;
}
}
<KNIP>
De eerste IF werkt perfect ( if ($i<=3) { etc. ) probleem is dat de 2e IF ( if ($orient="1") { etc. ) niet werkt. Standaard wordt altijd de eerste optie gekozen en ook al is $orient 2 (check ik door dump op scherm ( echo "$orient\n"; ) dan nog kiest hij voor de eerste keuze.
In de tabel":
Orientatie int(1) NOT NULL default '1',
Wat doet deze n00b fout ?
Weblog van Righteye's gezinnetje - De grote grappige plaatjes website