image as a hyperlink

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
kabucek
Forum Commoner
Posts: 50
Joined: Thu Sep 04, 2008 2:20 pm

image as a hyperlink

Post by kabucek »

hello all,

i got simple query with listing:

Code: Select all

 
$result2 = mysql_query("SELECT * FROM tbl_usr_pic_info where usr_email ='$email1' LIMIT 0 , 3 "); 
 
echo "<TABLE BORDER=0 CELLPADDING=4><TR>"; 
 
while($row2 = mysql_fetch_array($result2) )
{           // $row2[4]
echo ' <TD><img src =\'' . $row2[12] .'\' width="140" height="160" border="0" >'; 
        // $row2[3]
echo "<br />"; echo $row2[1]; echo "<br /> $"; echo $row2[2]; echo "</TD>"; 
 
echo "<TD width='10px'></TD>"; 
 
 
 
} ?>
 
and another code to list one big picture with some data:

Code: Select all

 
 
 
 
$result4 = mysql_query("SELECT * FROM tbl_usr_pic_info where usr_email ='$email1' and pic_info_id < '2'  "); 
 
$row4 = mysql_fetch_array($result4); 
$num4=mysql_numrows($result4);
 
 
 
 
                    
 ?>
 
<TABLE BORDER=0 CELLPADDING=4>
<TR>
    <TH ROWSPAN='15' ><img src ="<?php echo $row4[12]; ?>" width="240" height="320" border="0" ></TH>
    <td></td>
    <TD ><p style='font-size:small;font-weight:bold'> <?php echo $row4[1]; ?></p></TD> <TD> </TD>
    </TR> 
<TR>
    <td></td>
    <TD> </TD> <TD> </TD> 
    </TR>
 
<TR>
    <td></td>
    <TD> </TD> <TD> </TD>
    </TR>
<TR>
    <td></td>
    <TD> </TD>
     <TD> </TD>
    </TR>
<TR>
    <td></td>
    <TD><p style='font-size:x-small;'>Price</p> </TD>
     <TD></TD>
    <td><p style='font-size:x-small;'> $ <?php echo $row4[2]; ?></p></td>
    </TR>
 
<TR>
    <td></td>
    <TD><p style='font-size:x-small;'>Original/Reproduction</p> </TD>
     <TD></TD>
    <td><p style='font-size:x-small;'><?php echo $row4[3]; ?></p></td>
    </TR>
<TR>
    <td></td>
    <TD><p style='font-size:x-small;'>Style</p> </TD>
     <TD></TD>
    <td><p style='font-size:x-small;'><?php echo $row4[4]; ?></p></td>
    </TR>
<TR>
    <td></td>
    <TD><p style='font-size:x-small;'>Listed by</p> </TD>
     <TD></TD>
    <td><p style='font-size:x-small;'><?php echo $row4[5]; ?></p></td>
    </TR>
<TR>
    <td></td>
    <TD><p style='font-size:x-small;'>Size Type/Largest Dimension</p> </TD>
     <TD></TD>
    <td><p style='font-size:x-small;'><?php echo $row4[6]; ?>"</p></td>
    </TR>
<TR>
    <td></td>
    <td><p style='font-size:x-small;'>Signed?</p></TD>
     <TD></TD>
    <td><p style='font-size:x-small;'><?php echo $row4[7]; ?></p></td>
    </TR>
<TR>
    <td></td>
    <td><p style='font-size:x-small;'>Date of Creation</p></TD>
     <TD></TD>
    <td><p style='font-size:x-small;'><?php echo $row4[8]; ?></p></td>
    </TR>
<TR>
    <td></td>
    <TD><p style='font-size:x-small;'>Medium</p> </TD>
     <TD></TD>
    <td><p style='font-size:x-small;'><?php echo $row4[9]; ?></p></td>
    </TR>
<TR>
    <td></td>
    <TD><p style='font-size:x-small;'>Region of Origin</p> </TD>
     <TD></TD>
    <td><p style='font-size:x-small;'><?php echo $row4[10]; ?></p></td>
    </TR>
<TR>
    <td></td>
    <TD><p style='font-size:x-small;'>Subject </p></TD>
     <TD></TD>
    <td><p style='font-size:x-small;'><?php echo $row4[11]; ?></p></td>
    </TR>
<TR>
    <td></td>
    <TD><p style='font-size:x-small; font-weight:bold'>Description of Work</p> </TD>
     <TD></TD>
    <td><?php echo $row4[13]; ?></td>
    </TR>
<TR>
    <td></td>
    <TD> </TD>
     <TD> </TD>
    </TR>
<TR>
    <td></td>
    <TD> </TD>
     <TD> </TD>
    </TR>
 
</TABLE>
 
How to implement these 2 into 1(or other ways?) so if I click on one of the pic from first listing the second listing changes
? Meaning if I click on "small-1-pic" from the listing it will show up on the second.
Thanks
User avatar
angelicodin
Forum Commoner
Posts: 81
Joined: Fri Nov 13, 2009 3:17 am
Location: Oregon, USA

Re: image as a hyperlink

Post by angelicodin »

I'm sure this should of been posted in the code section and prolly with get moved, but......

try this
SELECT * FROM tbl_usr_pic_info WHERE usr_email ='$email1' AND pic_info_id < '2' LIMIT 0 , 3
Post Reply