RE: [PHP-DB] comparison problem
| From: | Rick Emery | Date: | Wed, 10 Oct 2001 14:10:47 +0000 |
| Subject: | RE: [PHP-DB] comparison problem | ||
| Groups: | php.db php.general | ||
| Request: | Send a blank email to php-db+get-13192@lists.php.net to get a copy of this message | ||
First problem: PHP understands good old American English. It don't do no
Dutch....<GRIN>
Anyway. As part of your debugging, did you print the values of
$uren_tegoed, $$uren_tegoed? Were they correct?
I'm a little concerned about your use of list(). I believe it should list a
list of variables into which values are placed; not a pointer to a variable.
-----Original Message-----
From: Bart Verbeek [mailto:b.verbeek@creative-edge.nl]
Sent: Wednesday, October 10, 2001 8:19 AM
To: Php-General; Php-Db-Help
Subject: [PHP-DB] comparison problem
Hello people,
I seem to have a problem with comparing a few values.
I'm queriing the db for $row_uren[uren] and $row_uren[uren_verbruikt]
$uren_tegoed = the difference between [uren] and [uren_verbruikt] from the
db.
Than I split up $uren_tegoed in $uren_int (whole numbers) and $uren_dec
(decimals).
I want to check if the decimals and if they are
- between 01 and 25 it has to be set to 25
- between 26 and 50 it has to be set to 50
- between 51 and 75 it has to be set to 75
- between 76 and 99 or is 00 it has to be set to 00
<?PHPCODE
#AANTAL UREN SPLITTEN (INT/DEC) EN KLOKJES WEERGEVEN
$uren_tegoed = $row_uren["uren"] -
$row_uren["uren_verbruikt"];
list ($$uren_tegoed) = split('.', $uren_tegoed);
if ($klok_dec >= "01" AND $klok_dec <= "25") {
$klok_dec = "25";
$klok_dec_image = "klok_4-1.gif";
} elseif ($klok_dec >= "26" AND $klok_dec <= "50") {
$klok_dec ="50";
$klok_dec_image = "klok_4-2.gif";
} elseif ($klok_dec >= "51" AND $klok_dec <= "75") {
$klok_dec ="75";
$klok_dec_image = "klok_4-3.gif";
} elseif ($klok_dec >= "76" AND $klok_dec <= "99" ||
$klok_dec == "0" ||
!isset($klok_dec)) {
$klok_dec ="0";
$klok_dec_image = "klok_4-0.gif";
--$klok_int;
} else {
$klok_dec ="ERROR";
$klok_dec_image = "ERROR";
}
PHPCODE?>
I keep getting the ERROR at the bottom of the page.
Can anyone help me with this??
Thanks in advance..
Bart
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net