RosieisSweet Posted November 6, 2006 Share Posted November 6, 2006 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. Link to comment https://forums.phpfreaks.com/topic/26381-pass-a-specific-value-to-another-page-in-href-line/ Share on other sites More sharing options...
glenelkins Posted November 6, 2006 Share Posted November 6, 2006 I am lost at what you are trying to do, what is $row_rs_patches_toptraining?? Link to comment https://forums.phpfreaks.com/topic/26381-pass-a-specific-value-to-another-page-in-href-line/#findComment-120632 Share on other sites More sharing options...
RosieisSweet Posted November 6, 2006 Author Share Posted November 6, 2006 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. Link to comment https://forums.phpfreaks.com/topic/26381-pass-a-specific-value-to-another-page-in-href-line/#findComment-120634 Share on other sites More sharing options...
glenelkins Posted November 6, 2006 Share Posted November 6, 2006 ok so the field is "ItemNumber"Have you run the sql query to select the information for the record? If so this code looks fine....is it in a loop for multiple items? Link to comment https://forums.phpfreaks.com/topic/26381-pass-a-specific-value-to-another-page-in-href-line/#findComment-120640 Share on other sites More sharing options...
RosieisSweet Posted November 7, 2006 Author Share Posted November 7, 2006 It is not a loop. I have run the query to select all the items in a specific set as follows:<?phpmysql_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. Link to comment https://forums.phpfreaks.com/topic/26381-pass-a-specific-value-to-another-page-in-href-line/#findComment-120697 Share on other sites More sharing options...
Caesar Posted November 7, 2006 Share Posted November 7, 2006 1. What's with the long variables?2. I will take a look at your code in a second. :) Link to comment https://forums.phpfreaks.com/topic/26381-pass-a-specific-value-to-another-page-in-href-line/#findComment-120700 Share on other sites More sharing options...
Caesar Posted November 7, 2006 Share Posted November 7, 2006 Print out the $row_rs_patches_toptraining array and make sure that the values are there. Link to comment https://forums.phpfreaks.com/topic/26381-pass-a-specific-value-to-another-page-in-href-line/#findComment-120702 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.