Jump to content

Help with Dynamic Links (I think that is what it is)


nick323

Recommended Posts

Ok so I am pretty new to messing with PHP (about a week now) and I have been trying to figure this out all day.  So I will show the code and explain what I am trying to do.

 

<?php
$numquery = "SELECT distinct num1, num2 from numdb where num1 = '$number'";

$result_numtype = $mysqli->query($numquery);
$num = mysqli_num_rows($result_numtype);

$i=0;
while ($i < $num) {
$numdata = mysqli_fetch_array($result_numtype,MYSQLI_ASSOC);
?>
<tr>
<td><?php echo '<a href="http://www.aol.com" target="_blank">' . $numdata["NumType"] . '</a>'; ?></td>
</tr>
<?php
$i++;
}
?>

 

 

ok so num1 is not a unique on the table so it is just pulling anything that matches it but only one time of course, which will change based on the number that is entered on the previous page which is where $number is coming from.

 

 

So my results might look something like this...

 

1

2

3

4

 

Right now with the code each one is a link to aol.com.  What I want is for each item to be a link to another results page (or even the same page some where if that is possible) and then send over a variable of the returned result line.  so 1 would send over 1, 2 would send 2 etc.

 

I hope I explained this well enough, if I need to attempt to clarify please let me know.

 

Thank you for the help

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.