Page 1 of 1

image as a hyperlink

Posted: Mon Nov 16, 2009 2:33 pm
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

Re: image as a hyperlink

Posted: Wed Nov 18, 2009 4:59 pm
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