You are here: Re: How to make a field of a dynamic table active link using PHP « All PHP « IT news, forums, messages
Re: How to make a field of a dynamic table active link using PHP

Posted by nemo on 06/07/05 13:19

On Tue, 07 Jun 2005 08:28:15 GMT, Kalogiannis Vassilis
<kalogiannisv@tellas.gr> wrote:

>I have a dynamic table on one page that is populated by general details
>from my warehouse (Code_number, item_description, etc)
>What I would like to do is that when someone click on the field
>"Item_description" then a new page will be loaded holding the details of
>the Item that was selected.
>I have the pages ready but I can not call the detailed page by just
>clicking on a field from the warehouse page
>
>It goes by no saying that i am just staring to learn PHP (total beginner
>:( But I am trying !!! ;-[
>
>Vasilis
If you can display the products from your warehouse on your page, can not
you use the same approach to display just one product on another page?

Anyways....

What you have to do is identify your item to the page in which you wish to
display the item and its details.
Something like this may help. Assuming that -
all your products are stored in a table called "warehouse",
all have a product_name,
and the page you want to hold your detail is "products.php" -

$TableName="warehouse";
$Query="SELECT * FROM $TableName order by product_name";
$Result=mysql_db_query ($DBName, $Query, $Link);
while ($Row=mysql_fetch_array ($Result))
{
print("<tr align=center><td><a
href=\"product.php?id=$Row[product_name]\">$Row[product_description]</font></a></td></tr>");
}

The receiving page, "products.php" will have in it something like -

$TableName="warehouse";
$Query="SELECT * FROM $TableName WHERE product_name='$id' ";
$Result=mysql_db_query ($DBName, $Query, $Link);
while ($Row=mysql_fetch_array ($Result))
{
do things
}

 

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

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