Jump to content

How to hyper link from query results


clearwaters

Recommended Posts

Hi,

 

I have a search results from a query like this:

 

Accomodation & Housing

Aqua & Hatcheries

Automotive

Beauty,Body & Sourl

Billing

Construction

Education

Electrical & Electronics

Entertainment

Financial Services

Food & Dining

Freelancers

Health Services

Home & Garden

Industries

Miscellaneous

 

I wanted to hyper link these lines as an input to further query:

 

For example: A link should establish to line item Industries, when i click on this, a further query to run with the results from another table with key word "Industries".

 

Can somebody please help me on this issue.

 

I am using dream weaver 5.5 for this project, if any help in this issue is greatly appreciated.

 

Thanks,

 

Link to comment
https://forums.phpfreaks.com/topic/254131-how-to-hyper-link-from-query-results/
Share on other sites

It is hard to help you when you don't post code.

 

You should be hyper-linking by setting the data to an anchor element, and passing a query string to the end of the URI.

 

<?php
echo '<a href="a/link/to/somewhere.php?find=' . $me . '">LINKING</a>';
//to get the value:
if(isset($_GET['find'])) {
echo $_GET['find'];
}
?>

$_GET

Below is the do while loop which is generating the results.

 

<?php do { ?>

            <?php echo  $row_category['category_name']."<br/>"; ?>

            <?php } while ($row_category = mysql_fetch_assoc($category)); ?></td>

 

I wanted the loop results to be hyper linked and pass it to another query input value.

 

Thanks much....

Thanks for the reply..

 

I am a new web programmer, per my understanding, AJAX is required to retrieve the results in same page, i need results to be appear in separate page.

 

Can you please advice how to accomplish this.

 

Thanks

 

Not true at all. AJAX can access separate pages just fine.

perhaps something like this...

 

<?php 
do { 
  ?>
  <a href="<NameOf2ndPage.php?NameOfUniqueValueToPass<?PHP echo $row_category['FieldNameOfUniqueValue']; ?>"><?PHP echo  $row_category['category_name']; ?></a><br/"
  <?PHP
} while ($row_category = mysql_fetch_assoc($category));
?>

Oops(missed the = sign)...

 

<?php

do {

  ?>

  <a href="<NameOf2ndPage.php?NameOfUniqueValueToPass=<?PHP echo $row_category['FieldNameOfUniqueValue']; ?>"><?PHP echo  $row_category['category_name']; ?></a><br/"

  <?PHP

} while ($row_category = mysql_fetch_assoc($category));

?>

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.