Re: Need a hint on how to display mysql field as a link to a query
- From: "Larry C" <lccronin@xxxxxxxxxxx>
- Date: Wed, 09 Apr 2008 20:41:34 GMT
Thank you very much
I can work with that and figure it all out.
Larry C
"Floortje" <none@xxxxxxxxx> wrote in message news:47fd2861$0$53214$dbd4b001@xxxxxxxxxxxxxxxxxx
Larry C schreef:Hello,
Hoping someone can point me in the correct direction. My Google searches are just getting me to many hits.
I have a database for a golf league. I want to display the names of the members but have the name be a link to there own page. I could "hard code" the page but I wanted to have the same option under the page for standings which will vary week to week.
index.php
$sql = "SELECT * FROM MEMBERS";
foreach($db->q($sql) as $member){
echo '<a href="members.php?memberId='.$members['memberId'].'">'.$member['name'].'</a>'
}
members.php
$sql = "SELECT * FROM members WHERE memberId = '.intval($_GET['memberId']).'";
if($db->q($sql)){
// display contents
}
note: change the $db->q() stuff to whatever you would like to use for conecting to the database.
Could someone just point me to a site that could explain it a bit. I need to learn how to do it because I think I want to do something similar with our schedule page.
Thanks
Larry C
.
- Follow-Ups:
- References:
- Prev by Date: Re: Need a hint on how to display mysql field as a link to a query
- Next by Date: Re: using different stylesheets for different browsers (how to)?
- Previous by thread: Re: Need a hint on how to display mysql field as a link to a query
- Next by thread: Re: Need a hint on how to display mysql field as a link to a query
- Index(es):