RE: [PHP] hyperlinking results from a sql query
| From: | George Pitcher | Date: | Thu, 01 May 2003 12:49:34 +0000 |
| Subject: | RE: [PHP] hyperlinking results from a sql query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145938@lists.php.net to get a copy of this message | ||
And to pass the name as well - as you had requested, the link would look
like:
echo "<a
href="page.php?id=$row[id]&name=$row[name]">$row[name]</a><BR>";
However, make sure that there are no spaces or other illegal characters as
that may break your link and prevent all the parameters being passed.
George
> -----Original Message-----
> From: Awlad Hussain [mailto:php@sheridan-phoenix.com]
> Sent: 01 May 2003 1:43 pm
> To: bob pilly; php-general@lists.php.net
> Subject: Re: [PHP] hyperlinking results from a sql query
>
>
> $result = mysql_query("YOUR_SQL_QUERY_HERE");
> while($row=mysql_fetch_array($result){
>
> echo "<a href="page.php?id=$row[id]">$row[name]</a><BR>";
> echo "$row[phonenumber]<BR>";
> }
>
> -awlad
>
> ----- Original Message -----
> From: "bob pilly" <bobpilly@yahoo.co.uk>
> To: <php-general@lists.php.net>
> Sent: Thursday, May 01, 2003 1:30 PM
> Subject: [PHP] hyperlinking results from a sql query
>
>
> > Hello all, im having problems trying to implement this
> > and hope someone can help?
> >
> > i have written a page that outputs the multiple
> > results of a query under column headings, e.g
> >
> > name phonenumber
> > test 1231231231
> > test2 123123123
> >
> > I want to be able to make the name part of every row
> > of output a hyperlink that will take the user to
> > another page and also pass the name field contents as
> > a varaible to that new page. Any ideas onhow to do
> > this?
> >
> > Thanks for any help in advance!
> >
> > __________________________________________________
> > Yahoo! Plus
> > For a better Internet experience
> > http://www.yahoo.co.uk/btoffer
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>