Damian Bursztyn
2006-11-23 15:09:00 UTC
Hi. I already read the documentation at
http://pear.php.net/manual/en/package.database.mdb2.php and trying to work
with MDB2 but have a little problem. I want to make a query settign the
types of the columns so i did this (working with mssql):
$mdb2 =& MDB2::factory($dsn, $options);
if (PEAR::isError($mdb2)) {
die($mdb2->getMessage());
}
$mdb2->loadModule('Datatype');
$mdb2->setFetchMode(MDB2_FETCHMODE_ASSOC);
$mdb2->setLimit(20, 10);
$datatypes = array('somedate' => 'date');
$result =& $mdb2->query('SELECT somedate FROM sometable', $datatypes);
// Always check that result is not an error
if (PEAR::isError($result)) {
die($result->getMessage());
}
while (($row = $result->fetchRow())) {
echo $row['somedate'] . "\n";
}
$mdb2->disconnect();
But the answer is something like "MDB2 Error: not found".
Is ok the code i wrote? im missing something?
http://pear.php.net/manual/en/package.database.mdb2.php and trying to work
with MDB2 but have a little problem. I want to make a query settign the
types of the columns so i did this (working with mssql):
$mdb2 =& MDB2::factory($dsn, $options);
if (PEAR::isError($mdb2)) {
die($mdb2->getMessage());
}
$mdb2->loadModule('Datatype');
$mdb2->setFetchMode(MDB2_FETCHMODE_ASSOC);
$mdb2->setLimit(20, 10);
$datatypes = array('somedate' => 'date');
$result =& $mdb2->query('SELECT somedate FROM sometable', $datatypes);
// Always check that result is not an error
if (PEAR::isError($result)) {
die($result->getMessage());
}
while (($row = $result->fetchRow())) {
echo $row['somedate'] . "\n";
}
$mdb2->disconnect();
But the answer is something like "MDB2 Error: not found".
Is ok the code i wrote? im missing something?
--
Todos los humanos profundos se deleitan en imitar a los peces
voladores jugando sobre las altas crestas de las olas. Consideran que lo
mejor
de las cosas es su superficie, lo que hay en la epidermis, sit venia verbo.
(Nietzsche)
Todos los humanos profundos se deleitan en imitar a los peces
voladores jugando sobre las altas crestas de las olas. Consideran que lo
mejor
de las cosas es su superficie, lo que hay en la epidermis, sit venia verbo.
(Nietzsche)