Help with PERL to PHP conversion

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zeezack
Forum Newbie
Posts: 5
Joined: Thu Apr 03, 2008 3:53 am

Help with PERL to PHP conversion

Post by zeezack »

I more familiar with PHP, but perhaps you guys can help me figure out what is going on with this code....


there is a section here.... that fetches the results from a mysql query...

---

--
Code

while ($sth->fetch) {
$dbs{$row[0]} = {};
$dbs{$row[0]}->{props} = [@row];
# print join(",", @row), "<BR>\n"; # 1,CELCAT,?,4,Sybase
}


now from my understanding here....

$dbs[$row[0]] = {}; - that makes it an empty array? an initializer of it..


$dbs{$row[0]}->{props} = [@row]; - now does this fill in the results into an element called props...

if you guys can explain in detail what exactly is going on here, it will help me a lot. :)
zeezack
Forum Newbie
Posts: 5
Joined: Thu Apr 03, 2008 3:53 am

Re: Help with PERL to PHP conversion

Post by zeezack »

How do these pointers work?

Code: Select all

 
        $dbs{$db}->{tbls}->{$tbl[0]} = {};
        $dbs{$db}->{tbls}->{$tbl[0]}->{props}   = [@tbl];
        $dbs{$db}->{tbls}->{$tbl[0]}->{flds}    = [];
        $dbs{$db}->{tbls}->{$tbl[0]}->{fnc_pre} = [];
        $dbs{$db}->{tbls}->{$tbl[0]}->{fnc_pst} = [];
        $dbs{$db}->{tbls}->{$tbl[0]}->{cols}    = [];
 
Post Reply