Subject RE: [firebird-php] FireBird/ADODB
Author Alan McDonald
> Alan McDonald wrote:
> >> Alan McDonald wrote:
> >>> Lester
> >>> Somehow this code
> >>> $users_table = (isset($db_prefix) ? $db_prefix :
> '') . 'users';
> >>>
> >>> $sql = "SELECT * FROM $users_table WHERE user_id = '1'";
> >>>
> >>> // Check if we already have an Admin user.
> >>> $result = $this->mDbConnection->Execute($sql);
> >>> if ($result)
> >>> {
> >>> // If the record exists, we update it.
> >>> $row = $result->FetchRow();
> >>> $this->mAdminUsername = $row['user_name'];
> >>> $this->mAdminPassword = $row['user_pass'];
> >>> }
> >>>
> >>> results in an error: undefined index $row[user_name'];
> >>>
> >>> it works fine under MySQL
> >>> any ideas?
> >> firebird driver should be returning lower case field and table
> >> names. There is
> >> a switch for it but I forget where.
> >> I did try to convince people that upper case would be more
> >> logical but it fell
> >> on deaf ears :(
> >>
> >> --
> >> Lester Caine - G8HFL
> >
> > wish I knew where it was supposed to be getting converted.
>
> define('ADODB_ASSOC_CASE',0);
> In bw it's set in the generic connect code, so changing it in the
> driver did
> not work. In your case probably just un-commenting it in the driver and
> setting it to 0 should work.
> I've not had a chance to go back and look - still playing with
> stuff for Monday :(
>
> --
> Lester Caine - G8HFL
I tried that and also actually changed the fetch field code to do this
switch (ADODB_ASSOC_CASE) {
case 2: // the default
$fld->name = strtolower($ibf['alias']);
if (empty($fld->name)) $fld->name = strtolower($ibf['name']);
break;
case 0:
$fld->name = strtolower($ibf['alias']);
if (empty($fld->name)) $fld->name = strtolower($ibf['name']);
break;
case 1:
$fld->name = strtolower($ibf['alias']);
if (empty($fld->name)) $fld->name = strtolower($ibf['name']);
break;
}

but no lusk yet
Alan