Jump to content

Pass a specific value to another page in HREF line.


RosieisSweet

Recommended Posts

I am very new to PHP and need some help. I need to have my HREF tag identify a specific record on the ItemNumber field of my recordset when the button is clicked. Here is what I have so far...

<a href="p_desct2.php?ItemNumber=<?php echo $row_rs_patches_toptraining['ItemNumber']; ?>"><img src="/Assets/0601s.jpg" alt="Top Training Unleashed Recall Button" width="120" height="120" border="0" /></a>

I do not know how to make it select the specific ItemNumber in that field.

Also, do I have to define ItemNumber... if so, can you point me to a reference that will show me where and how.

Thank you to anyone that can assist.
It is the name of the recordset that includes the field ItemNumber. As I am new... I may have this all wrong. I want this href to send the value of ItemNumber to the action page so that it will respond with the information from the database for that item number.
It is not a loop. I have run the query to select all the items in a specific set as follows:

<?php
mysql_select_db($database_conn_pawscouts, $conn_pawscouts);
$query_rs_patches_toptraining = "SELECT ItemNumber, ItemName, ItemWebDescription, SmallImagePath, LargeImagePath, AmountInStock, Image1, Image1Caption, Image2, Image2Caption, Image3, Image3Caption FROM tbl_inventory WHERE ItemNumber >= '0600' AND ItemNumber <'0700' ORDER BY ItemNumber ASC";
$rs_patches_toptraining = mysql_query($query_rs_patches_toptraining, $conn_pawscouts) or die(mysql_error());
$row_rs_patches_toptraining = mysql_fetch_assoc($rs_patches_toptraining);
$totalRows_rs_patches_toptraining = mysql_num_rows($rs_patches_toptraining);
?>

As you can see, this query pulls all the items with an Item number between 0600 and 0700. There are 3. The page the button appears on has a grid (there are several of these pages) containing small images of each item in a table format. On this particular page there are three buttons to select. The object is to have the action page return the formatted information for whichever of the three choices the person has clicked (ie, the item descriptions etc for the specific ItemNumber associated with that button).

You can view a static sample of one of the pages at http://www.pawscoutsusa.com/p_buddy.html if that will help you picture what I am trying to do. The action page will generate a popup with all the relevant information for the item.

Thank you so much for your patience. Any info you can give will be a great help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.