473,581 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

image display in second if

201 New Member
the ids and images for the 2nd if statement are pulling the 1st record information to generate the record. how do i change this to where the if statement grabs the correct record and not the referring one.

thanks in advance for your help!

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $result = mysql_query("SELECT a.Id, a.Type, 
  3. a.Dates, 
  4. a.Uidfk as Uidfk, 
  5. b.Id as Did, 
  6. b.comment as Comment, 
  7. b.dates as Day, 
  8. b.sfk as Sfk ,
  9. c.sfk as sfk1, 
  10. d.Memo as Memo,
  11. d.Date as Dates1,
  12. aes_decrypt(e.ProfileName, '$Ukey') as Name,
  13. substr(i.Path, 4) as Path
  14. FROM 
  15. asstatusupdate as a   
  16. left join asstatusdata as b 
  17. on a.id = b.sfk 
  18. left join asmanystatusupdate as c
  19. on b.sfk = c.sfk
  20. left join ascomments as d
  21. on d.id = c.cfk
  22. right join onlyonew_hquis.ASWebInfo as e
  23. on e.Uidfk = a.uidfk
  24. right join onlyonew_hqups.ASManyAlbums as f
  25. on f.UserId=a.uidfk
  26. right join onlyonew_hqups.ASAlbums as g
  27. on f.AlbumId=g.Id
  28. right join onlyonew_hqups.ASTitle as h
  29. on g.Id=h.AlbumId
  30. right join onlyonew_hqups.ASData as i
  31. on h.Id=i.TitleId
  32. where a.uidfk in (select friendid from onlyonew_hquis.asfriends where uidfk0='1') and i.DefaultProfilePic='Y' order by dates desc;
  34. ");
  36. $result1 = mysql_query("SELECT a.Id, a.Type, 
  37. a.Dates, 
  38. a.Uidfk as Uidfk, 
  39. b.Id as Did, 
  40. b.comment as Comment, 
  41. b.dates as Day, 
  42. b.sfk as Sfk ,
  43. c.sfk as sfk1, 
  44. d.Memo as Memo,
  45. d.Date as Dates1,
  46. aes_decrypt(e.ProfileName, '$Ukey') as Name,
  47. substr(i.Path, 4) as Path
  48. FROM 
  49. asstatusupdate as a   
  50. left join asstatusdata as b 
  51. on a.id = b.sfk 
  52. left join asmanystatusupdate as c
  53. on b.sfk = c.sfk
  54. left join ascomments as d
  55. on d.id = c.cfk
  56. right join onlyonew_hquis.ASWebInfo as e
  57. on e.Uidfk = a.uidfk
  58. right join onlyonew_hqups.ASManyAlbums as f
  59. on f.UserId=a.uidfk
  60. right join onlyonew_hqups.ASAlbums as g
  61. on f.AlbumId=g.Id
  62. right join onlyonew_hqups.ASTitle as h
  63. on g.Id=h.AlbumId
  64. right join onlyonew_hqups.ASData as i
  65. on h.Id=i.TitleId
  66. where a.uidfk in (select friendid from onlyonew_hquis.asfriends where uidfk0='1') and i.DefaultProfilePic='Y' and c.sfk = '$comment_id' order by dates desc; 
  67. ");
  69. $category_id = '';
  71. while ($row = mysql_fetch_assoc($result)) {
  72.   if ($row['Id'] != $category_id) {
  73.       //Output the markup for a new category here.
  74.       $category_id = $row['Id'];
  76.         $Cat = $row['Type'];
  77.         $Memo = $row['Comment'];
  78.         $Did = $row['Did'];
  79.         $Dates = $row['Day'];
  80.         $Name = $row['Name'];
  81.         $Path = $row['Path'];
  82.         $FriendId = $row['Uidfk'];
  84.         echo '<table align="center" width="40%" border="3" cellpadding="0" cellspacing="0">'; 
  85.         echo '<tr>';
  86.         echo '<td align="center">'; echo "$Name"; echo "</br>"; echo  '<a href="source/source.php?FriendId=' ."$FriendId". '"><img src="' ."$Path". '" height="120" width="120" align="middle" border="3" /></a>'; echo '</td>';
  87.         echo '<td align="center"> '; echo "$Dates" ; echo "</br>"; echo "</br>"; echo "$Cat"; //echo "</td>";
  88.         echo "</br>"; 
  89.          echo "$Memo"; echo '</td>'; // echo "</br>";
  90.         echo '<td>'; echo "$Did" ; echo '</td>'; 
  91.         echo '</tr>';
  92.         echo '</table>';
  94.   }
  95.   // Output comment markup here
  96.       //    $comment_id = '';
  97.       //while ($row1 = mysql_fetch_assoc($result1)){
  98.        if(!empty($row['sfk1'])){
  99.       //    $comment_id = $row['sfk1'];
  101.         $Fk = $row['sfk1'];
  102.           $Memo1 = $row['Memo'];
  103.         $FriendId1 = $row['Uidfk'];
  104.         $Dates1 = $row['Dates'];
  105.         $Path1 = $row['Path'];
  107.         // echo "$comment_id";
  108.         echo '<table align="center" width="500" border="3" cellpadding="7" cellspacing="0">'; 
  109.         echo '<tr>';
  110.         echo '<td align="center">'; echo "$Name"; echo "</br>"; echo  '<a href="source/source.php?FriendId=' ."$FriendId1". '"><img src="' ."$Path1". '" height="120" width="120" align="middle" border="3" /></a>'; echo '</td>';
  111.         echo '<td>'; echo "$Fk"; echo '</td>'; 
  112.        // echo "</br>"; 
  113.         echo '<td align="center">'; echo "$Dates1"; echo "</br>"; echo "</br>"; echo "$Memo1"; echo '</td>'; 
  114.         // echo "</br>";
  115.         echo '</tr>';
  116.         echo '</table>';
  118.         } // closing if
  119.         //    } // closing while
  120. } // closing main
  121. ?>
Apr 29 '11 #1
0 983

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

Similar topics

by: Anthony Delorenzo | last post by:
Please refer to http://www.sfu.ca/~ajdelore/ Stylesheet: http://www.sfu.ca/~ajdelore/anthony.css I am having a problem that I assume is a browser-specific glitch. When I load the above page in IE 6 on Windows NT, the second image (camel) does not appear unless I resize the window, and then it blinks into existence. The stylesheet...
by: Tyrone Slothrop | last post by:
I am coding a site which involves uploading images. All of the PHP and display is OK but the client wants to be able to display the image thumbnail on the upload page and show the full image on mouseOver instead of the popup I coded. The section of code below works perfectly in Firefox but not at all in IE (why am I not surprised?). The...
by: Qindong Z. | last post by:
My asp.net application send image to web browser. The browser begin to display part of image before download finished. (In Slow Network). How can I force brower to display image after the image fully downloaded? IIS, HTML or Internet Explore?? Thanks
by: Brett Romero | last post by:
My application start like this: frmMaster MainForm = new frmMaster(); System.Windows.Forms.Application.Run(MainForm); The flow is that MainForm shows then a SecondForm shows after the user does something. This is an MDI app so SecondForm needs to always be inside MainForm. There are times I need to automatically load the app and...
by: cjaserver | last post by:
This works fine in IE, but is breaking in Firefox, and reported in Netscape as well. I can't determine why. http://www.chartermainstreetgld.com click on the real estate section on the left nav area. You can see where the green real estate image is being moved down a line in firefox, where IE displays it correctly.
by: JebBushell | last post by:
Here are two lines from the HTML view of my page that should display the same jpg: <asp:Image id="Image2" ImageUrl="~/SpotImages/paw.jpg" width="16" height="16" runat="server"></asp:Image> <asp:Image id="Image3" ImageUrl="../SpotImages/paw.jpg" width="16" height="16" runat="server"></asp:Image> In VS2003, only the second displays...
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo" runat="server"/> <asp:Label ID="CompanyPicture" runat="server"/> I have 2 links that open the windows to preview these images. The previewed...
by: adubra | last post by:
Hi there, I am using a device context (DC) and a buffer to successfully draw to screen. However, when I update the DC at very high frame rate and drag the frame containing the image very quickly over the screen or I drag another window on top of the fast display, I get errors (Pyassertion ....). I believe those are related to a conflict between...
by: shotokan99 | last post by:
i have this issue: showpic.php ================================================ $ch = curl_init(); $timeout = 0; curl_setopt ($ch, CURLOPT_URL, $xmyurl); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // Getting binary data curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
by: viji chandran | last post by:
Hi... I am developing an application in .Net 2005 which has a DataGridView, like Microsoft outlook. I want to mark read and unread for each mail. I am trying to put one image for read(open mail image) and
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.