You are here: Re: Plz, help « PHP « IT news, forums, messages
Re: Plz, help

Posted by "Mark Rees" on 07/12/05 13:06

""adolfas"" <adolfas@nese.lt> wrote in message
news:27.17.23681.6F663D24@pb1.pair.com...
> Hi,
>
> I have a line:
>
> $sql="select u.*, p.name_lt as pareiga from nese_users u left join
> nese_pareigos p on p.id=u.pareiga order by data desc";
>
> As I understand there are 2 tables: nese_users and nese_pareigos
> I need to know what atributes belong to what table form that line.
> Thanks

I hope this is what you mean. Try this for further reading if so
http://www.w3schools.com/sql/default.asp

Breaking it down:

select
--retrieve the following fields
u.*,
--* means all fields from this table (u)
p.name_lt as pareiga
-- and name_lt (renamed to pareiga) from table (p)
from
nese_users u
--(this is table u, as in u.*)
left join
--retrieve all of the rows from table u, as well as all the rows in the next
table where the ON condition is true
nese_pareigos p
--this is table p, as in p.name_lt
on
p.id=u.pareiga
--this restricts the rows retrieved from table p
order by data desc
--means that the rows returned are ordered in this way

 

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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация