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

Reply
Old 01-25-2007, 10:43 AM Link To Other Data
Junior Talker

Posts: 4
Name: Bob Williams
Trades: 0
I have a MYSQL database and a table that contains 15 fields
After attaching to the database and displaying some of the fields uisng the following code: All the data in the database is being displayed in a "Do while if" statement.
<tr>
<td bgcolor="#00FF99"><font faces="Arial,Helvetica,sans-serif" size="2"><? echo $state;?><font></td>
<td><font faces="Arial,Helvetica,sans-serif" size="3"><? echo $name;?><font></td>
<td><font faces="Arial,Helvetica,sans-serif" size="2"><? echo $location;?><font></td>
<td><font faces="Arial,Helvetica,sans-serif" size="2"><? echo $dates;?><font></td>
<td><font faces="Arial,Helvetica,sans-serif" size="2"><? echo $type;?><font></td>
<td><font faces="Arial,Helvetica,sans-serif" size="2"><? echo $agegroup;?><font></td>
</tr>

I want the "State" field to be displayed as a link, so that when you click on it, it will call another "php" file that would display the other associated data.

Last edited by bobwill; 01-25-2007 at 10:50 AM..
bobwill is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-26-2007, 05:18 AM Re: Link To Other Data
celticbrue's Avatar
Extreme Talker

Posts: 175
Location: Wiltshire, England
Trades: 0
Try this

<td><font faces="Arial,Helvetica,sans-serif" size="2"><? echo <a href=\"newpage.php?state=$state\">$state</a>;?><font></td>

Then run a query on the new page to pull the associated data

Ian
__________________
Found this useful? - HIT MY TALKUPATION!


Please login or register to view this content. Registration is FREE
celticbrue is offline
Reply With Quote
View Public Profile
 
Old 01-26-2007, 07:55 AM Re: Link To Other Data
Junior Talker

Posts: 4
Name: Bob Williams
Trades: 0
Thanks for your response. I think I understand what you want me to do. I forgot to mention that in the database there may be more than one entry for a "State" Example: Florida----->Data, Florida----->Data1, Florida----->Data3. Could I just pass the "Index" associated with the State to the othere "PHP" to pull the data for that particualr "State" being clicked???
bobwill is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Link To Other Data
 

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.13594 seconds with 12 queries