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
Search found 4 matches
- Tue Jul 11, 2006 1:23 pm
- Forum: PHP - Code
- Topic: [solved] printing an array of objects
- Replies: 7
- Views: 366
- Tue Jul 11, 2006 12:53 pm
- Forum: PHP - Code
- Topic: [solved] printing an array of objects
- Replies: 7
- Views: 366
- Tue Jul 11, 2006 12:48 pm
- Forum: PHP - Code
- Topic: [solved] printing an array of objects
- Replies: 7
- Views: 366
- 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...