Grafische gevorderde |
|
Ik heb de volgende php code
<?php
if(IsSet($_POST['nw1']) && IsSet($_POST['nw2'])) {
if(IsSet($_POST['days'])) {
$days = $_POST['days'];
} else {
$days = 2;
}
$get_provinces = mysql_query("SELECT
*
FROM
provinces
WHERE
seconds_inactive >= '" . $days . "'
AND
networth >= '" . $_POST['nw1'] . "'
AND
networth <= '" . $_POST['nw2'] . "'
AND
checked = '1'
ORDER BY
seconds_inactive DESC, networth DESC") or die(mysql_error());
} else {
if(IsSet($_POST['days'])) {
$days = $_POST['days'];
} else {
$days = 2;
}
$get_provinces = mysql_query("SELECT
*
FROM
provinces
WHERE
seconds_inactive >= '" . $days . "'
AND
checked = '1'
ORDER BY
seconds_inactive DESC, networth DESC") or die(mysql_error());
}
?>
<?php if(IsSet($_POST['nw1']) && IsSet($_POST['nw2'])) { if(IsSet($_POST['days'])) { $days = $_POST['days']; } else { $days = 2; } * FROM provinces WHERE seconds_inactive >= '" . $days . "' AND networth >= '" . $_POST['nw1'] . "' AND networth <= '" . $_POST['nw2'] . "' AND checked = '1' ORDER BY } else { if(IsSet($_POST['days'])) { $days = $_POST['days']; } else { $days = 2; } * FROM provinces WHERE seconds_inactive >= '" . $days . "' AND checked = '1' ORDER BY } ?>
Maar het probleem is, als hij de if doet dan pakt hij de input niet in de query, dus selecteert hij niets :S als hij de gewone else pakt (dus 2) dan pakt ie m in 1x wel
|