You are here: Re: Linking tables to display data? « PHP Programming Language « IT news, forums, messages
Re: Linking tables to display data?

Posted by Rik on 10/20/06 03:19

Garry Jones wrote:
> DUH!
>
> Ok, I am starting to grasp this now.
>
> A little bit nearer since my last effort.
>
> $ml_collect='SELECT * FROM ml_lopp LEFT JOIN scfmforening.scfmfor ON
> ml_lopp.scfmnum = scfmforening.scfmnum ORDER BY loppnmn';
> $ml_upg=mysql_query($ml_collect);
> $num_ml=mysql_numrows($ml_upg);
>
> But that is misfiring and not picking up any rows.
>
> Can you see why?

First of all, don't use SELECT *, use the actual fieldnames you want.
Second of all is that you JOIN a table, not a table field.

If I understand your table fields correctly:

SELECT x.`scfmnum`,y.`loppnmn`
FROM `ml_lopp` x
LEFT JOIN `scfmforening` y
ON x.`scfmnum` = y.`scfmnum`
ORDER BY x.`loppnmn`

Grtz,
--
Rik Wasmus

 

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

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