You are here: Re: best way to show a mysql join « PHP Programming Language « IT news, forums, messages
Re: best way to show a mysql join

Posted by Gary L. Burnore on 02/02/06 00:19

On Wed, 01 Feb 2006 10:08:40 +0200, G0ng <hkosmidi@softnet.tuc.gr>
wrote:

>I have the following tables:
>
>students
>id, name,....
>
>lessons
>id,description,....
>
>studentslessons
>id,studentid,lessonid,grade
>
>I want to list the lessons of student with name="John" for example.
>
>The one way to do it is :
>select id from students where name="John" and grab the id. then select *
>from studentslessons where studentid=id;
>
>the other is
>select * from students,studentslessons where students.name="john" AND
>students.id=studentslessons.studentid
>
The second would be more efficient.
>
>Which is more efficient when using php4 and mysql 4.1? I'm using a
>rather old computer Pentium 800MHz.

THe cpu and versions are irrelevent.
>
>thanks

Try comp.databases.mysql next time (added to subject line for your
convenience)
--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
Official .sig, Accept no substitutes. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
===========================================================================

 

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

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