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
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

Link to comment
Share on other sites

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....

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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));
?>

Link to comment
Share on other sites

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));

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.