From: <tr...@us...> - 2002-09-09 15:49:42
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv10129 Modified Files: pgsql.inc.php mysql.inc.php Log Message: Added boolean->number conversion Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pgsql.inc.php 9 Sep 2002 10:56:08 -0000 1.8 --- pgsql.inc.php 9 Sep 2002 15:49:15 -0000 1.9 *************** *** 351,353 **** --- 351,364 ---- } + // conversion from the annoying boolean type + function db_cast_boolean_float($expr) + { + return "CASE WHEN $expr THEN 1.0 ELSE 0.0 END"; + } + + function db_cast_boolean_int($expr) + { + return "CASE WHEN $expr THEN 1 ELSE 0 END"; + } + ?> Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** mysql.inc.php 9 Sep 2002 10:56:08 -0000 1.12 --- mysql.inc.php 9 Sep 2002 15:49:26 -0000 1.13 *************** *** 282,284 **** --- 282,295 ---- } + // conversion from the annoying boolean type + function db_cast_boolean_float($expr) + { + return $expr; + } + + function db_cast_boolean_int($expr) + { + return $expr; + } + ?> |