Hello there...
I have a little issue here....
Which one is better(I think object) but would like to hear from someone more
experienced....
class Persons
{
var $name;
var $comments;
var $thoughts;
var $email;
some functions.....
}
object in array:
while($line = $result->FetchRow()) //using ADODB
{
$person[$line['id']] = &new Persons;
$person[$line['id']]->name = $line['name'];
$person[$line['id']]->thoughts = $line['thoughts'];
$person[$line['id']]->email = $line['email'];
$person[$line['id']]->comments = $line['comments'];
}
or plain array:
while($line = $result->FetchRow())
$person[$line['id']]=Array("name"=> $line['name'],"thoughts"=>$l ine['thoughts
'],"email"=>$l ine['email'],"comments"=>$l ine['comments']);
thanx and respect....
p.
I have a little issue here....
Which one is better(I think object) but would like to hear from someone more
experienced....
class Persons
{
var $name;
var $comments;
var $thoughts;
var $email;
some functions.....
}
object in array:
while($line = $result->FetchRow()) //using ADODB
{
$person[$line['id']] = &new Persons;
$person[$line['id']]->name = $line['name'];
$person[$line['id']]->thoughts = $line['thoughts'];
$person[$line['id']]->email = $line['email'];
$person[$line['id']]->comments = $line['comments'];
}
or plain array:
while($line = $result->FetchRow())
$person[$line['id']]=Array("name"=> $line['name'],"thoughts"=>$l ine['thoughts
'],"email"=>$l ine['email'],"comments"=>$l ine['comments']);
thanx and respect....
p.
Comment