facil cambia esto
Código PHP:
<?php
mysql_connect("localhost","root","yoyoyo");
$result=mysql_db_query("path","select * from imagenes where nombre='".mysql_escape_string($_POST['caja1'])."' ");
//Mostramos los registros
while ($row=mysql_fetch_assoc($result))
{
echo '<img src="'.$row['ruta'].'">';
echo '</img>';
}
mysql_free_result($result);
?>
por esto
Código PHP:
<?php
$conec=mysql_connect("localhost","root","yoyoyo");
$b=$_POST['caja1'];
$result=mysql_db_query("path","select * from imagenes where nombre LIKE '%{$b}%' ",$conec);
//Mostramos los registros
while ($row=mysql_fetch_assoc($result))
{
echo '<img src="'.$row['ruta'].'">';
echo '</img>';
}
mysql_free_result($result);
mysql_close($conec)
?>