-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
"bba" <bba.news@kandu.dk> writes:
> Jeg skal hente data fra en Oracle via ODBC i DBI modulet, Alle andre
> statement går godt, undtagen når jeg benytter dato formater. Hvis jeg
> indsætter dato direkte i statement er alt ok, men ikke når de benyttes
> som variabler, og de skal oprindeligt komme fra et kaldende script, så
> det et must at det fungerer.
> Jeg får ikke en fejlmeddelse fra Oracle, men script error i min Apache
> Server(Errorlog).
> Kan statementet laves anderledes for at få de samme data, eller andre
> gode forslag.
> Vil bibeholde ODBC connectionen !!
>
> -- Kode --
> use DBI;
> $user="xx";
> $pass="xx";
>
> $dbh=DBI->connect"dbi
BC:<hostname>",$user,$pass) or die &db_error;
>
> $sth=$dbh->prepare("SELECT * from xx WHERE Dato BETWEEN '$from' AND
> '$to'");
Kan du ikke bare manuelt quote dem?
$sth=$dbh->prepare("SELECT * from xx WHERE Dato BETWEEN ".($dbh->quote($from))." AND ".($dbh->quote($to)));
- --
Dennis
I have always thought explanations were overkill when correcting
mistakes. A simple "that's wrong" must suffice. I mean, people are
always aware why they are wrong. They just make mistakes to annoy you.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <
http://mailcrypt.sourceforge.net/>
iD8DBQE9vVRAo6hqeoa8JFgRAsV6AJ43ZdeCFXSybXV7iNwsplGd0XoIMwCePz6G
k7wKZ082f1S3o/F5ipxCI6s=
=mo/b
-----END PGP SIGNATURE-----