You are here: get data from 2 tables, 1 is a count « PHP SQL « IT news, forums, messages
get data from 2 tables, 1 is a count

Posted by <mail on 10/03/82 11:30

I have a customer ID for both tables..

table 1 contains customer info
table 2 contains items everyone owns


I can get the info from table one select on id.

I can get a count of items on table 2 count(*) on id

But I want to do this in one query so i can show results in a table
and even order by results of table one or two



What I have is
select t1.count(*) as count,t2.*, from t1,t2 order by count

But that gives me an error pointing to (*)

Can anyone give me the proper syntax plus explanation.. please:)

 

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

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