Reply to Re: arranging data results in multiple tables.

Your name:

Reply:


Posted by toodi4 on 12/07/06 07:27

> I think I might have figured this out after posting it. Would the way
> to do this be to run queries within the while loop? Something like
> this (rough)
>
> query = "select company from table";
> $result = mysql_query($query);
> while ($row = mysql_fetch_array($result))
> {
> $company = $row['company'];
>
> $display .= "<table><tr><td>company</td></tr>";
>
> $get_items_sql = "select item from where company =$company";
> $get_itmes_result = mysql_query($query);
>
> while ($row1 = mysql_fetch_array($get_items_result))
> {
> $item = $row1['item'];
>
> $display .= "<td>item</td>";
> -------------
>
> and then another while loop for subitems.
>
>

Well that didn't work as I expected. I probably should have tested it
before posting. The second query doesn't seem to like the row item
$company. Even when I tried hard coding a value just to see what the
output would be, the results I got were weird. The original query rows
each got returned for the number of rows in the original query, 15 x
15.

Anyway, I did base this off of something I had read. But I'm really
stuck now and need help.

[Back to original 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

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