Subject Re: firebase15
Author dleec45
--- In, Lester Caine <lester@l...> wrote:
> Helen Borrie wrote:
> >>I have no clue. Just trying to get things converted and all the
bugs out
> >
> > This would be definitely be a bug to eliminate!!
> Seconded.
> There are quite a lot of things that MySQL does the long winded way,
> simply because they don't have Triggers :)
> For some ideas on managing sessions download ADOdb.
> The session module will tell you all you need ...
I have the session creation working as that wasn't that hard to
accomplish and it shows up in all the links that I can currently and
are in the navigation html.

The ADOdb is exactly what I'm trying to use for this conversion from
MySQL. The problems I'm running into is that there are several
processes which deal with things that I don't know the replacement for
in FB, like the following example which locks the credit table, does a
bit of processing and finally unlocks it and there are a couple of
MySQL functions which I don't find in ADOdb as replacements. I know
this is a bit long, but a good example if you want to wade through it!!
// Lock Table
$Query = "LOCK TABLES credit WRITE";
... some processing....

$Query = "SELECT COUNT(ID) " .
"FROM credit " .
"WHERE ExternalID = '$externalID' ";
... some processing....

list($count) = mysql_fetch_row($DatabaseResult);
... some processing....

$Query = "INSERT INTO credit " .
"(ExternalID, Purchaser, Purchased, " .
"Expires, InitialValue, RemainingValue) VALUES (" .
"'$externalID', " .
"$purchaser," .
"NOW(), " .
"$value, " .
if(!($DatabaseResult = $db->Execute($Query)))
... some processing....

$newID = mysql_insert_id($DatabaseLink);
// And FINALLY, unlock table

I think that this section is a good example of how this whole
conversion entails. There is a lot of complex code (for me anyway)
that I need to figure out. I was hoping that getting the FB stuff
working, the rest would be OK as PHP is PHP and the only thing I'm
trying to do is change the interface at this stage. Anyway, thanks
Helen and Lester for your comments and suggestions to date.
Regards, Lee