NYCPHP Meetup

NYPHP.org

[nycphp-talk] Native PHP functions in MySQL?

Chris Snyder csnyder at chxo.com
Fri Dec 26 13:48:39 EST 2003


Wow, thanks Dan! An excellent Boxing Day gift to those of us without 
Oracle. :-)

I'm just beginning to wrap my head around the Nested Set approach, 
having always used a Materialized Path. It's always nice to find that 
there's more than one way to do it.

The clew project (NYPHP's new mailing list / forum) uses a Celko-style 
Nested Set to store the message heirarchy, courtesy of Hans Zaunere's 
pNSM class. Once we work through the implementation and have it up and 
running, it would be a great idea to take a shot at the Partial Order 
approach spelled out by Tropashko, using myphp to do the math.

   csnyder


Dan Cech wrote:

> Actually there is a UDF which can execute PHP code already.  Written 
> by David Sklar, you can find it here:
>
> <http://www.sklar.com/page/article/myphp>
>
> As for usefulness, it could be very handy if you wanted to for 
> instance implement partial order nested sets:
>
> <http://www.dbazine.com/tropashko4.html>
>
> There are plenty of situations where the ability to execute php code 
> could be a Good Thing, though for most cases the same results can be 
> achieved with SQL-99 stored procedures, which are supported in MySQL 
> 5.x and much more portable than embedded php code.
>
> Dan Cech
>
> jon baer wrote:
>
>> i noticed this project just recently:
>>
>> http://freshmeat.net/projects/judf/?topic_id=66
>>
>> basically a wrapper using mysql w/  CREATE FUNCTION foo RETURNS STRING
>> SONAME "foo.so"; to run Java natively ... so you could do this:
>>
>> mysql> SELECT foo("classes/MyClasss", COLUMN1, COLUMN2) FROM foobar;
>>
>> i wonder what the major advantages of this really are or if its 
>> overkill, im
>> assuming the same thing could be done w/ php ... but beyond filtering 
>> what
>> would it be good for?
>>
>> - jon
>>
>> pgp key: http://www.jonbaer.net/jonbaer.asc
>> fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47
>>
>> _______________________________________________
>> talk mailing list
>> talk at lists.nyphp.org
>> http://lists.nyphp.org/mailman/listinfo/talk
>>
>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk






More information about the talk mailing list