RE: [PHP] MySQL + PHP question

2005-07-26 Thread Shaw, Chris - Accenture
arent. HTH. C. -Original Message- From: Mark Rees [mailto:[EMAIL PROTECTED] Sent: 26 July 2005 13:39 To: php-general@lists.php.net Subject: Re: [PHP] MySQL + PHP question * This e-mail has been received by the Revenue Internet

Re: [PHP] MySQL + PHP question

2005-07-26 Thread André Medeiros
On Tue, 2005-07-26 at 13:39 +0100, Mark Rees wrote: > "André Medeiros" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > One thing I didn't quite explain myself well... I'm building this to > > register objects on a permission system. > > > > The SQL weight is heavy as it is, and I

Re: [PHP] MySQL + PHP question

2005-07-26 Thread Mark Rees
"André Medeiros" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > One thing I didn't quite explain myself well... I'm building this to > register objects on a permission system. > > The SQL weight is heavy as it is, and I want to save queries as much as > possible. Making two queries t

RE: [PHP] MySQL + PHP question

2005-07-26 Thread André Medeiros
You're missing the point here. I know how to get the parent project's info. I know recursiveness. I _JUST_ don't know how to get the current and parent project's info in just ONE QUERY (since I'm trying to save them because the sql weight is getting pretty heavy). -- PHP General Mailing List (htt

Re: [PHP] MySQL + PHP question

2005-07-26 Thread André Medeiros
One thing I didn't quite explain myself well... I'm building this to register objects on a permission system. The SQL weight is heavy as it is, and I want to save queries as much as possible. Making two queries to extract information about a project and it's parent is not something I'd want to do.

RE: [PHP] MySQL + PHP question

2005-07-26 Thread Shaw, Chris - Accenture
t on MySQL, but this query should work on MSSQL and Oracle. HTH. C. -Original Message- From: André Medeiros [mailto:[EMAIL PROTECTED] Sent: 26 July 2005 12:53 To: Shaw, Chris - Accenture Cc: php-general@lists.php.net Subject: RE: [PHP] MySQL + PH

Re: [PHP] MySQL + PHP question

2005-07-26 Thread Mark Rees
Are you familiar with Joe Celko's tree theory? It might help you understand more about the problem. http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=235427 -- Hello, Consider this: tbl_project(id, name, parent) 1 6 / \ / \ 2 3 7 8 /\ 4 5 if tbl_project.parent

RE: [PHP] MySQL + PHP question

2005-07-26 Thread André Medeiros
On Tue, 2005-07-26 at 11:45 +0100, Shaw, Chris - Accenture wrote: > Hello, > > Consider this: > tbl_project(id, name, parent) > > 1 6 > / \ / \ > 2 3 7 8 >/\ > 4 5 > > if tbl_project.parent = 0 then the project is the "top" parent. > Th

RE: [PHP] MySQL + PHP question

2005-07-26 Thread Shaw, Chris - Accenture
Hello, Consider this: tbl_project(id, name, parent) 1 6 / \ / \ 2 3 7 8 /\ 4 5 if tbl_project.parent = 0 then the project is the "top" parent. Therefore, 1 and 6 have the field parent = 0. So, say if you have project 5, do yo