473,387 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

image display in second if

201 100+
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;
  33.  
  34. ");
  35.  
  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. ");
  68.  
  69. $category_id = '';
  70.  
  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'];
  75.  
  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'];
  83.  
  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>';
  93.  
  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'];
  100.  
  101.         $Fk = $row['sfk1'];
  102.           $Memo1 = $row['Memo'];
  103.         $FriendId1 = $row['Uidfk'];
  104.         $Dates1 = $row['Dates'];
  105.         $Path1 = $row['Path'];
  106.  
  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>';
  117.  
  118.         } // closing if
  119.         //    } // closing while
  120. } // closing main
  121. ?>
  122.  
Apr 29 '11 #1
0 972

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

Similar topics

2
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...
2
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...
1
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...
3
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...
4
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...
1
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> ...
9
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"...
0
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...
1
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,...
4
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.