Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass a variable generated by hyperlink?

Status
Not open for further replies.

34534534534555

IS-IT--Management
Joined
Jan 8, 2003
Messages
240
Location
GB
Hello,

I have generated the following code, which displays a list of records from a mysql database, and makes the auctionid field the hyperlink.

Code:
<?php 
include(&quot;dbconnect.php&quot;);

$sql = &quot;SELECT auction.auctionid, auction.bookcondition, book.edition, bid.bidprice
		FROM auction, book
		LEFT JOIN bid ON auction.auctionid=bid.auctionid
		WHERE sellerusername <> '$username'
		AND auction.isbn = book.isbn&quot;;
		
$query = mysql_query($sql) or die(&quot;Cannot query the database: &quot; . mysql_error());
	
echo &quot;<table width=500 border=1 cellspacing=0 cellpadding=0>&quot;;
echo &quot;<tr><td width=75 align=left>Auction</td><td width=100 align=left>Book Condition</td><td width=100 align=left>Book Edition</td>
<td width=100 align=left>Current Price</td></tr>&quot;;
	
	while ($myrow = mysql_fetch_array($query)) 
	{	
		$auctionid = $myrow[&quot;auctionid&quot;];
		$bookcondition = $myrow[&quot;bookcondition&quot;];
		$bookedition = $myrow[&quot;edition&quot;];
		$bidprice = $myrow[&quot;bidprice&quot;];
		
	echo 
		&quot;<tr>
			<td width=100 align=left><a href=bid.php>$auctionid</a></td>
			<td width=100 align=left>$bookcondition</td>
			<td width=100 align=left>$bookedition</td>
			<td width=100 align=left>$bidprice</td>
		</tr>&quot;;  
	}


mysql_free_result($booktitles);
?>

The problem i am trying to solve, and hope you will be able to, is how to pass the auctionid to the bid page which all the hyperlinks point to?

Thanks in Advance


| Feedback is always appreciated as this will help to further our knowledge as well |
 
Code:
<a href=bid.php?auctionid=$auctionid>$auctionid</a></td>

something like this ?
 
many thanks, that works just as required.

simple one eh!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top