<?php $link = mysql_connect("localhost","root",""); mysql_select_db("dbimagenes",$link); $result=mysql_query("select count (*) FROM jerarquia where tipo='$actual' && padre = '$padre'"); $existe=mysql_result($result,0); ?>