Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Generate Link to Search using Field Data


Recommended Posts



I am trying to generate a link on my product_info page where I can list a number of actors, each stored separately in 10 new fields, Cast1..Cast2......Cast10...


I have no problem listing the actors, but what I am trying to do is make each one a hyperlink so when you click an actors name, it will search the database for every other record with them in it.


This is what I have to generate static text...


<td class="smallText" width="99" height="0" align="right" valign="top">Cast:</td>
<td class="smallText" width="884" height="0" align="left" valign="top"><font color="ff0000"><?php echo $product_info['Cast1']; ?> <?php echo $product_info['Cast2']; ?> <?php echo $product_info['Cast3']; ?> <?php echo $product_info['Cast4']; ?> <?php echo $product_info['Cast5']; ?> <?php echo $product_info['Cast6']; ?> <?php echo $product_info['Cast7']; ?> <?php echo $product_info['Cast8']; ?> <?php echo $product_info['Cast9']; ?> <?php echo $product_info['Cast10']; ?> </font></td>


I have been trying for hours to amend the echo command to use '<a href="' . tep_href_link(" etc etc and then grab the contents of Cast1..Cast2 to infill the data to go in the link and then to show on the screen as the link. eg instead of >Click this link</a>; use something like > $Cast1</a>


It just refuses to use the data from the field tho and just shows 'Cast1' as the text and not the actual data.


Can anyone point me in the right direction of how to generate a link from data held in the database?




Link to comment
Share on other sites

Nomaly this would work.


 <a href="http://www.address.com?search=<?php echo $product_info['Cast1']; ?>"><?php echo $product_info['Cast1']; ?></a>


The ?search= was just used as an example.

What was once an opinion became a fact to be later proven wrong... ~ Me

Link to comment
Share on other sites

Ignore the above, got it working perfectly!


Thanks for the help Misspell, its appreciated....you just solved in 2mins what ive been sat here for about 2hrs looking at and pondering lol


Cheers mate



Link to comment
Share on other sites


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

  • Create New...