PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
se
Forum Newbie
Posts: 2 Joined: Mon Nov 24, 2003 9:37 am
Post
by se » Mon Nov 24, 2003 9:37 am
What do I have to do in order to get the $title field in to be used as the link to a page?
For inst: echo "<TD><a href=\"../no1.php?id=".$myrow[id]."\">View</a> ";
Instead of "view" I would like to use the .$myrow[title]
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Mon Nov 24, 2003 9:40 am
Try this (single quotes instead of double mean you don't need all the ''s):
Code: Select all
echo '<TD><a href="../no1.php?id='.$myrow['id'].'">'.$myrow['title'].'</a>';
also have a read of the second link in my signature for why you should use $myrow['id'] instead of $myrow[id].
Mac
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Mon Nov 24, 2003 9:42 am
think it should be like this
Code: Select all
echo "<TD><a href="../no1.php?id=".$myrow['id']."">".$myrow['title']."</a> ";
Mark
se
Forum Newbie
Posts: 2 Joined: Mon Nov 24, 2003 9:37 am
Post
by se » Mon Nov 24, 2003 2:36 pm
Thanks to both of you