User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,572 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,636 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 962 | Replies: 9 | Solved
Reply
Join Date: Oct 2007
Location: malta
Posts: 19
Reputation: dragon@dragon64 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dragon@dragon64 dragon@dragon64 is offline Offline
Newbie Poster

Help Hyerlink from Mysql

  #1  
Oct 26th, 2007
Hi this might sound like a simple question to most but it is something that i have been trying for quiet a while. I have a table in mysql, which contains a name of a football match, date, time , and one of the variables is a link address to another page which contains photos. i would like to know who to write the code in php, so that when the list of matches comes up, one can choose the line he/she would like to see see, by clicking on the desired hyperlink.

to understand better what i am trying to say please visit this link http://www.dragon64.net/schedule1.php.

I would like that the photos variable would be clickable taking the user to the desired page

patrick
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 9
Reputation: Xavier2k is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
Xavier2k's Avatar
Xavier2k Xavier2k is offline Offline
Newbie Poster

Re: Hyerlink from Mysql

  #2  
Oct 26th, 2007
Hi Patrick,

If you put an <a> tag around your link string you'll achive the desired affect.
Reply With Quote  
Join Date: Oct 2007
Location: malta
Posts: 19
Reputation: dragon@dragon64 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dragon@dragon64 dragon@dragon64 is offline Offline
Newbie Poster

Re: Hyerlink from Mysql

  #3  
Oct 27th, 2007
hi Xavier2k

This is the string i had , where do i have to put the <a>

<td> <a href="$row_schedule['photos']" </a> <?php echo $row_schedule ['photos']; ?></td>

thank you in anticipation
Reply With Quote  
Join Date: Oct 2007
Posts: 9
Reputation: Xavier2k is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
Xavier2k's Avatar
Xavier2k Xavier2k is offline Offline
Newbie Poster

Re: Hyerlink from Mysql

  #4  
Oct 27th, 2007
Assuming your PHP code is correct the following should work:
<td><a href="$row_schedule['photos']"><?php echo $row_schedule ['photos']; ?> </a></td>
Reply With Quote  
Join Date: Oct 2007
Location: malta
Posts: 19
Reputation: dragon@dragon64 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dragon@dragon64 dragon@dragon64 is offline Offline
Newbie Poster

Help Re: Hyerlink from Mysql

  #5  
Nov 6th, 2007
Originally Posted by Xavier2k View Post
Assuming your PHP code is correct the following should work:
<td><a href="$row_schedule['photos']"><?php echo $row_schedule ['photos']; ?> </a></td>

hi

i uploaded the script you suggested but still i have the same error, when i click on the result that comes from the database, the system does not link to the proper link.

you can have a look at the page in question http://www.dragon64.net/schedule1.php and see what happens.

thank you in anticipation for your assistance
Reply With Quote  
Join Date: Sep 2007
Location: Budapest
Posts: 252
Reputation: fatihpiristine has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 14
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: Hyerlink from Mysql

  #6  
Nov 6th, 2007
try this.
<td><a href=<?php print "$row_schedule['photos']; ?>"><?php print $row_schedule ['photos']; ?> </a></td>
Do a favour, leave me alone
Reply With Quote  
Join Date: Sep 2007
Location: Buenos Aires
Posts: 30
Reputation: chmazur is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
chmazur's Avatar
chmazur chmazur is offline Offline
Light Poster

Re: Hyerlink from Mysql

  #7  
Nov 6th, 2007
Try fatihpiristine's post, or this:

<td><a href="<?=$row_schedule['photos']?>"><?=$row_schedule['photos']?> </a></td>


ch.-
Reply With Quote  
Join Date: Oct 2007
Location: malta
Posts: 19
Reputation: dragon@dragon64 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dragon@dragon64 dragon@dragon64 is offline Offline
Newbie Poster

Help Re: Hyerlink from Mysql

  #8  
Nov 7th, 2007
Originally Posted by fatihpiristine View Post
try this.
<td><a href=<?php print "$row_schedule['photos']; ?>"><?php print $row_schedule ['photos']; ?> </a></td>

This is what i got when i tried the above
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/d/r/a/dragonaquarius/html/schedule1.php on line 149
Reply With Quote  
Join Date: Oct 2007
Location: malta
Posts: 19
Reputation: dragon@dragon64 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
dragon@dragon64 dragon@dragon64 is offline Offline
Newbie Poster

Re: Hyerlink from Mysql

  #9  
Nov 7th, 2007
Originally Posted by chmazur View Post
Try fatihpiristine's post, or this:

<td><a href="<?=$row_schedule['photos']?>"><?=$row_schedule['photos']?> </a></td>


ch.-


it worked beutifully.
Reply With Quote  
Join Date: Sep 2007
Location: Budapest
Posts: 252
Reputation: fatihpiristine has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 14
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: Hyerlink from Mysql

  #10  
Nov 7th, 2007
Originally Posted by dragon@dragon64 View Post
This is what i got when i tried the above
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/d/r/a/dragonaquarius/html/schedule1.php on line 149


didnt work coz you didnt drop the space there after row_schedule..

not my problem.
Do a favour, leave me alone
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 6:03 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC