Search found 4 matches

by jriano
Tue Jul 11, 2006 1:23 pm
Forum: PHP - Code
Topic: [solved] printing an array of objects
Replies: 7
Views: 366

The Ninja Space Goat: yes your change does it! so that means that the elements of the array article[] have pointers to articleTemp but no copies? I was thinking that article[1....n] each n would have a copy of what tempArticle was at the moment of the assignement!
Thanks to all you guys
by jriano
Tue Jul 11, 2006 12:53 pm
Forum: PHP - Code
Topic: [solved] printing an array of objects
Replies: 7
Views: 366

jamiel, I don'tunderstand what you mean
by jriano
Tue Jul 11, 2006 12:48 pm
Forum: PHP - Code
Topic: [solved] printing an array of objects
Replies: 7
Views: 366

thanks pickle, but actually if i include this line inside the while loop it prints the right data echo "<h1>$tempArticle->title</h1><p>$tempArticle->body</p>"; So I think the problem is on how I assign the tempArticle object to the article[] array of objects, but I dont see why
by jriano
Tue Jul 11, 2006 12:02 pm
Forum: PHP - Code
Topic: [solved] printing an array of objects
Replies: 7
Views: 366

[solved] printing an array of objects

hello guys, is there something wrong with this code? there are 3 articles, but it just prints the last one 3 times! while($row=mysql_fetch_array($result ,MYSQL_ASSOC)){ $tempArticle->id=$row['id']; $tempArticle->category=$row['category']; $tempArticle->title=$row['title']; $tempArticle->body=$row['b...