[thelist] running a mysql query after receiving the php $_GET var.

Jay Blanchard jay.blanchard at niicommunications.com
Mon Oct 6 09:29:06 CDT 2003


[snip]
what I am trying to figure out is how to query all of the other  
information in that table of the "id" selected and
display it. I am not really sure how to use this variable sent within  
the query.
...

QUERY ON PAGE ONE.

  <?  do {  ?>

  <a href= "details.php?id=<?php echo $row_Recordset1['id']?> "><img  
src="<?php echo    			$row_Recordset1['thumbpath'];
?>"></a>

<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));

------------------------------------------------------------------------

-------------------------------------------------------

TRYING TO USE THE VARIABLE 'ID' TO QUERY OTHER INFO ABOUT ID SELECTED..

<?php
if(isset($_GET['id'])) {
	
	echo $row_Recordset1[$_GET['id']];  }
	
-- 
[/snip]

I cannot be sure (not enough code to know) but I think you actually want
to perform the query on the second page

$query = "SELECT foo FROM bar WHERE id = '" . $_GET['id'] . "' ";


More information about the thelist mailing list