You are here: Re: [PHP] MySQL + PHP question « PHP « IT news, forums, messages
Re: [PHP] MySQL + PHP question

Posted by "Mark Rees" on 09/30/58 11:22

"Andrι Medeiros" <andre.caum@gmail.com> wrote in message
news:1122379553.3499.14.camel@vaio...
> 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. I know recursiveness, but
> thanks for the pointers and for the reply :)
>
> Best regards

I must admit I still don't really get what you are looking for. Does this
query help?

select c.field1 AS childfield1,
c.field2 AS childfield2,
(etc)
p.field1 AS parentfield1,
p.field2 AS parentfield2,
(etc)
FROM
child AS c
LEFT JOIN
parent AS p
ON c.parent=p.id

?

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация