[ciapug] On or Off ...
Tony Bibbs
tony at tonybibbs.com
Tue Aug 23 09:27:30 CDT 2005
Yeah, sorry...
Dan Schlichting wrote:
> That link is broke. Should it be http://propel.phpdb.org?
>
> Thanks
>
> Dan
> On Tue, 23 Aug 2005 08:54:35 -0500, Tony Bibbs wrote
>
>>Carl Olsen wrote:
>>
>>>I got really deep into object oriented PHP this weekend and decided to start
>>>with something a little more simple, so I'm creating a class for each table
>>>with select, insert, update, and delete functions that all use prepared
>>>statements. I agree that the security blanket is great.
>>
>>When you get done with all of this and have time to breathe, you
>>should really consider looking at Propel, http://prople.phpdb.org.
>> That tool creates a set of object from your database (generally one
>>class per table). These objects are pure PHP objects that the
>>Propel runtime can then use to do all your insert/update/delete
>>logic magically. Thus you could have something like:
>>
>>// Retrieve existing customer
>>$customer = new Customer();
>>$customer->setId(5);
>>$customer->get();
>>
>>// Create an order
>>$order = new Order();
>>$order->setProductCode(4);
>>$order->setUnitPrice(20.00);
>>$order->setQuantity(3);
>>
>>// Assign order to customer
>>$customer->addOrder($order);
>>
>>// Save it all
>>$customer->save();
>>
>>This gets you out of the business of writing a lot of SQL and
>>underneath it uses prepared statements.
>>
>>--Tony
>>_______________________________________________
>>ciapug mailing list
>>ciapug at cialug.org
>>http://cialug.org/mailman/listinfo/ciapug
>
>
>
> -----------------------------------------------------
> Dan J Schlichting
> http://www.cpugeek.org
> dan at cpugeek.org
>
> _______________________________________________
> ciapug mailing list
> ciapug at cialug.org
> http://cialug.org/mailman/listinfo/ciapug
More information about the ciapug
mailing list