Date: 06/30/00
- Next message: Adam Thompson: "Re: [phplib] PHPLib sessions - problem with ac_store() in ct_sql.inc"
- Previous message: Mike Payson: "Re: [phplib] Simple configuration question"
- In reply to: Carl Youngblood: "RE: [phplib] database abstraction"
- Next in thread: Adam Thompson: "Re: [phplib] database abstraction"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
* Carl Youngblood wrote:
> 1) You will have to do some changing of your SQL statements just to get
> them to parse correctly in Oracle (for example there are differences in
> CREATE TABLE statements, Oracle doesn't have "auto_increment" columns,
Within Oracle, you have to use SEQUENCEs. Unfortunately,
db_oci8.inc didn't include the method nextid(), which
should return a number which is guaranteed to be unique.
Thomas Kosch and I recently submitted the missing nextid()
method to the stable CVS tree of PHPLIB which automatically
creates a proper sequence in Oracle.
When you use MySQL, you shouldn't use the auto_increment
feature. Instead you should use the method nextid() within
the DB class provided by PHPLIB.
Another good point is: _never_ use num_rows(). Within Oracle,
that method in db_oci8.inc doesn't work properly. So if you
would write:
$db->query("select foo from bar");
print "We have ".$db->num_rows()." rows";
You _should_ write:
$db->query("select count(*) as numrows from bar");
$db->next_record();
$numrows = $db->f("numrows");
$db->query("select foo from bar");
print "We have $numrows rows";
while ($db->next_record())
{
}
> Don't think that I'm advocating Oracle over MySQL. I'm just saying that
> there are so many differences that you really are getting into something a
> lot more complex than you would first think.
Yes. Furthermore, the database abstraction layer from PHPLIB
doesn't seem to be very consistent and portable. We
had to fiddle around a lot with db_oci8.inc until it
worked nearly as we expected to work.
--
<?php class new_media_development {
var $url="http://www.rent-a-phpwizard.de/";
var $fon="0931/7843792"; var $fax="0931/7843795";
} /* Björn Schotte, "Mr. PHP" */ ?>
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Adam Thompson: "Re: [phplib] PHPLib sessions - problem with ac_store() in ct_sql.inc"
- Previous message: Mike Payson: "Re: [phplib] Simple configuration question"
- In reply to: Carl Youngblood: "RE: [phplib] database abstraction"
- Next in thread: Adam Thompson: "Re: [phplib] database abstraction"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

