|
Posted by Kalogiannis Vassilis on 06/07/05 14:12
nemo wrote:
> 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
> }
>
>
>
Just to make things more clear to you (so you can help me better ;)
This is the code i use to populate the dynamic table (the project is
about a site that holds info about the players of a local tennis club
$trans_Recordset1 = "boys12";
if (isset($HTTP_POST_VARS['RadioGroup1'])) {
$trans_Recordset1 = (get_magic_quotes_gpc()) ?
$HTTP_POST_VARS['RadioGroup1'] : addslashes($HTTP_POST_VARS['RadioGroup1']);
}
mysql_select_db($database_players_conn, $players_conn);
$query_Recordset1 = sprintf("SELECT * FROM %s WHERE Points>0 ORDER BY
Points DESC,Surname asc", $trans_Recordset1);
$Recordset1 = mysql_query($query_Recordset1, $players_conn) or
die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
Up to now I have the players name for the age of 12 with some >0 points
in the dynamic table
I guess that the trick of calling the Player_details page is quoting you
> 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>");
> }
But I can not figure out where or how to use it
Don't forget I am in the very begining of learning PHP (and I use
Dreamweaver as editor)
Your help is much appreciated
Vassilis
[Back to original message]
|