Code: Select all
<?php
$qu=mysql_query("select * from la order by li desc limit 5");
while ($max=mysql_fetch_array($qu))
{
if ($max['im']=='')
$max['im']='ims/default.jpg';
echo '<td><table class=media><tr><td>
<input type="image" name="select" value="'.$max["li"].'" src="'.$max['im'].'" width=150 height= 200/>';
echo'</a></td></tr><tr>';
if (strlen($max["ti"])>16)
$mal["ti"]=substr($max["ti"],0,16).'...';
echo '<td><input type="submit" name="select" value="'.$max["ti"].'" class="trans2"></td></tr></table></td>';
}//end while
?>
Code: Select all
//$qu=mysql_query("select * from la where li like '".$select."'");
$qu=mysql_query("select * from la where ti like '".$select."'");
while ($max=mysql_fetch_array($qu))
{
if ($max['im']=='')
$max['im']='ims/default.jpg';
echo '<table class=select><tr><td>
<img src="'.$max['im'].'" width=300 height=400/>';
echo'</a></td></tr><tr>';
echo '<td>'.$max["ti"].'</td></tr></table>';
}//end while
echo'<tr><td>'.$qu['im'].'</tr><td>';one of them will work but not both$qu=mysql_query("select * from la where li like '".$select."'");
$qu=mysql_query("select * from la where ti like '".$select."'");
i want both of them to work, if the user clicks on the image or the ti (string) the same result will come up for the user. i have tried if condition and other thing nothing worked either the image or the string not both.(i know that in this code i show here, has "//" before $qu)
thanks in advanced