Re: [MDB] Final thought
| From: | Thierry Bothorel | Date: | Wed, 17 Sep 2003 16:18:02 +0000 |
| Subject: | Re: [MDB] Final thought | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7874@lists.php.net to get a copy of this message | ||
"Lukas Smith" <smith@backendmedia.com> a écrit dans le message de
news:001401c37ced$ac9d28e0$4e00a8c0@vandal...
>
> I assume you are not using the datatype conversion yet? Or you manually
> calling convertResultRow()?
Yes I used datatype conversion, and the never used convertResult function. I
did not used dtatatype conversion at first. But after reading the tutorial
and then a previous mail from you where you said they may not be needed for
some databases and/or field types, I changed my mind. For portability, as I
don't know which databases will be used, and to avoid to change the code
again in the future because a new DBMS driver need it, I decided to use it
systematically. There is little more work to code it, but I do it once. For
example my code look like this systematically:
$sql_3_data = array($room, $starttime, $endtime, $starttime,
$endtime, $starttime, $endtime);
$param_types = array('integer', 'integer', 'integer',
'integer',
'integer', 'integer', 'integer');
$res2 = $mdb->execute($prepared_query_3, 'integer',
$sql_3_data, $param_types);
OR
$sql = "SELECT id, area_name
FROM mrbs_area
ORDER BY area_name";
$types = array('integer', 'text');
$res = $mdb->query($sql, $types);
Thierry B.