Search found 6 matches

by amk221
Mon Feb 12, 2007 12:04 pm
Forum: PHP - Code
Topic: Referencing
Replies: 7
Views: 561

ahh cool thats clever stuff, so really - i don't need to concern myself with referencing because under the hood it's doing it already.
by amk221
Mon Feb 12, 2007 2:58 am
Forum: PHP - Code
Topic: Referencing
Replies: 7
Views: 561

Ok thanks, but why wouldn't I? Because in that case, my only option is to make a copy of the variable?
by amk221
Sun Feb 11, 2007 4:24 pm
Forum: PHP - Code
Topic: Referencing
Replies: 7
Views: 561

Referencing

I've never used referencing until now, and I'm starting to think about performance etc... If there is a constant WEBSITE_ROOT, and I wanted to print this out inside heredoc (which you can't do) I would do this: $root = WEBSITE_ROOT; Then inside the heredoc I can print the variable $root instead. My ...
by amk221
Thu Feb 08, 2007 12:01 pm
Forum: PHP - Theory and Design
Topic: Objects and Databases
Replies: 6
Views: 1201

Ok cool, so now I have my Test class and Test_DAO class.

When I make a new Test_DAO i can call load_test($test_id), which I've named more appropriately get_test_by_id($id), and it returns a Test object. That more like?

Re the while loop - good point ;-)
by amk221
Thu Feb 08, 2007 6:49 am
Forum: PHP - Theory and Design
Topic: Objects and Databases
Replies: 6
Views: 1201

Thanks all.
arborint or anyone, could you tell me more about ActiveRecord, I've googled it and my understanding is it's a design pattern? But I can't find much info about it and how it relates to (my)sql.

also, what is the alternative to my while statement
by amk221
Wed Feb 07, 2007 5:00 pm
Forum: PHP - Theory and Design
Topic: Objects and Databases
Replies: 6
Views: 1201

Objects and Databases

Usually when I code a small web app, I do everything procedurally, making use of functions here and there. I try to code as efficiently as possible. I'm hoping to do my next project using objects... Imagine I have a database table called Tests, and I wanted to echo everything in it. Originally I wou...