Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Closed Thread
Dynamic php table link problem
Old 02-08-2009, 09:30 PM Dynamic php table link problem
Junior Talker

Posts: 4
Trades: 0
Hi guys,

I'm trying to make the id#'s in the "id" column in to links.

PHP Code:
table border="0" align="center" bordercolor="#000000" bgcolor="#000000">
  <tr>
    <td bordercolor="#000000" class="abc style1 style2 style5">id</td>
    <td bordercolor="#000000" class="abc style1 style2 style5"><div align="center">Name</div></td>
    <td bordercolor="#000000" class="abc style1 style2 style5"><div align="center">Injury</div></td>
    <td bordercolor="#000000" class="style1 abc"><div align="center"><span class="style5"><strong>Length</strong></span></div></td>
  </tr>
  <?php do { ?>
    <tr>
      <td bordercolor="#000000" bgcolor="#FFFFFF"><span class="style7"><a href="player.php?year=2007&amp;skin=default&amp;id="><?php echo $row_MySQL['id']; ?></a></span></td>
      <td bordercolor="#000000" bgcolor="#FFFFFF"><span class="style7"><?php echo $row_MySQL['Name']; ?></span></td>
      <td bordercolor="#000000" bgcolor="#FFFFFF"><span class="style7"><?php echo $row_MySQL['Injury']; ?></span></td>
      <td bordercolor="#000000" bgcolor="#FFFFFF"><span class="style7"><?php echo $row_MySQL['Length']; ?></span></td>
    </tr>
    <?php } while ($row_MySQL mysql_fetch_assoc($MySQL)); ?>
</table>
So how do I mak it so that:

1234 | Mike |Broken leg| 1 week
3456 | Greg | Headache| Prob
when you click 1234 it links to player.php?year=2007&amp;skin=default&amp;id=1234

and clicking 3456 links to player.php?year=2007&amp;skin=default&amp;id=3456

and how can i make the bg of every other row gray?
like:
white
gray
white
gray
white

Thanks for the help.

Last edited by cjvolcom; 02-08-2009 at 09:40 PM..
cjvolcom is offline
View Public Profile
 
 
Register now for full access!
Old 02-08-2009, 09:55 PM Re: Dynamic php table link problem
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
Trades: 0
PHP Code:
<table border="0" align="center" bordercolor="#000000" bgcolor="#000000">
  <tr>
    <td bordercolor="#000000" class="abc style1 style2 style5">id</td>
    <td bordercolor="#000000" class="abc style1 style2 style5"><div align="center">Name</div></td>
    <td bordercolor="#000000" class="abc style1 style2 style5"><div align="center">Injury</div></td>
    <td bordercolor="#000000" class="style1 abc"><div align="center"><span class="style5"><strong>Length</strong></span></div></td>
  </tr>
<?php
  
  
for ($i 0$row_MySQL mysql_fetch_assoc($MySQL); $i++)
  {
    
?>
    <tr style="background-color:<?php echo ($i === 0) ? '#ffffff' '#999999'?>;">
      <td bordercolor="#000000"><span class="style7"><a href="player.php?year=2007&skin=default&id=<?php echo $row_MySQL['id']; ?>"><?php echo $row_MySQL['id']; ?></a></span></td>
      <td bordercolor="#000000"><span class="style7"><?php echo $row_MySQL['Name']; ?></span></td>
      <td bordercolor="#000000"><span class="style7"><?php echo $row_MySQL['Injury']; ?></span></td>
      <td bordercolor="#000000"><span class="style7"><?php echo $row_MySQL['Length']; ?></span></td>
    </tr>
<?php
    
  
}
  
?>
</table>
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
View Public Profile
 
Old 02-08-2009, 10:36 PM Re: Dynamic php table link problem
Junior Talker

Posts: 4
Trades: 0
That worked great thank you.
cjvolcom is offline
View Public Profile
 
Closed Thread     « Reply to Dynamic php table link problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12292 seconds with 12 queries