Hallo,
Ik haal uit de database de volgende gegevens: optie=1 duur=1maand
Hoe komt het dat hij steeds de laatste uitleest? (optie=2 duur=15maand)
<?
if($optie!='1'){ if($duur!='1maand')
{$pr = '20.00';}}
if($optie!='1'){ if($duur!='2maand')
{$pr = '40.00';}}
if($optie!='2'){ if($duur!='1maand')
{$pr = '10.00';}}
if($optie!='2'){ if($duur!='15maand')
{$pr = '40.00';}}
$SQL = "
SELECT
optie, duur
FROM
advertentie ORDER BY `id` DESC LIMIT 1
";
$data = mysql_query($SQL) or die (mysql_errno());
while($row=mysql_fetch_object($data))
{
echo' '. $pr .' ';
}
';
?>
Alvast bedankt.
Jacques.
Oplossing was simpel, toch bedankt voor het mee denken.
Het moest == ipv !=
<?
if($optie=='1'){ if($duur=='1maand')
{$pr = '20.00';}}
if($optie=='1'){ if($duur=='2maand')
{$pr = '40.00';}}
if($optie=='2'){ if($duur=='1maand')
{$pr = '10.00';}}
if($optie=='2'){ if($duur=='15maand')
{$pr = '40.00';}}
$SQL = "
SELECT
optie, duur
FROM
advertentie ORDER BY `id` DESC LIMIT 1
";
$data = mysql_query($SQL) or die (mysql_errno());
while($row=mysql_fetch_object($data))
{
echo' '. $pr .' ';
}
';
?>
1.102 views