By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,659 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,659 IT Pros & Developers. It's quick & easy.

Linking Recordsets In Two Pages To Display Master And Detail Record

P: 7
What I really want to do is to be able to link two pages together using an ID, The table involved displays an image stored on the File Server that has the image details stored in the Database called. THE Database used is MySQL

"Support" on a Table Called "profiles":

The problem is how do I get this piece of codes to link to a details page called "PATRONS_DETAILS.PHP" and display information about one particular database detail. With ID given below as: recordID ".$info['id'] . "
Expand|Select|Wrap|Line Numbers
  1. <td valign=bottom><a href=patrons_details.php?recordID ".$info['id'] . " class=nav4>+More</a></td></tr></table>"; 
  2. }
  3. ?>
  4.  
  5. /* I used this code to select a Database to use*/
  6. mysql_select_db("support") or die(mysql_error()); 
  7.  
  8. //I used this tp Retrieves data from MySQL Table 
  9. $data = mysql_query("SELECT * FROM profiles WHERE type_name = 'Patrons'") or die(mysql_error());
  10.  
  11. //Puts it into an array 
  12. while($info = mysql_fetch_array( $data ))
  13.  
  14. // This variable calls a function that I use to shorten the output of the string 
  15. displayed by the Database Table field called: 'profile_detail'
  16. $text = $info['profile_detail'];
  17.  
  18. //DISPLAY STARTS FROM HERE[/quote] [quote]"profiles"
  19.  
  20. Echo "<table width=100% class=table2><tr><td valign=top rowspan=2>
  21.  
  22. FILE SERVER LOCATION OF THE IMAGE TO BE DISPLAYED WITH THE DATABASE FIELD STORING THE IMAGE INFO CALLED "profile_photo"
  23.  
  24. <img src=C:/Inetpub/wwwroot/sites/supportbridges/www/profile/".$info['profile_photo'] ."></td>";
  25.  
  26. THIS PORTION OF HTML AND PHP CODES DISPLAY THE DATABASE FIELD STORING THE PROFILE NAME CALLED "profile_name"  AND ITS 
  27. CALLS THE VARIABLE FOR THE FUNCTIONS THAT SHORTENS THE "profile_detail" DATABASE FIELD INFO WITH . ".ShortenProfile($text)."
  28.  
  29. Echo "<td valign=top colspan=2><b>Profile:</b><b> ".$info['profile_name'] . "</b></td></tr><tr><td valign=top>".ShortenProfile($text)."</td>
  30.  
  31. This is the link that passes the RecordID to the next page
  32.  
  33. <td valign=bottom><a href=patrons_details.php?recordID=".$info['id'] . "class=nav4>+More</a></td></tr></table>"; 
  34. }
  35. ?>
Nov 16 '06 #1
Share this Question
Share on Google+
1 Reply


cassbiz
100+
P: 202
Whew :)

Your question and description is a little bit all over the place and real hard to follow.

As what I gathered from your question is the following. You want to retrieve an image from one database table and have it link together with another value that is located in a different table resulting in displaying a support page.

Is that correct?

If that is the case, read up on this thread http://www.thescripts.com/forum/thread562112.html
Nov 16 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.