Ver Mensaje Individual
  #37 (permalink)  
Antiguo 09/11/2011, 10:13
edyuin
(Desactivado)
 
Fecha de Ingreso: septiembre-2011
Mensajes: 283
Antigüedad: 13 años, 7 meses
Puntos: 10
Respuesta: como hacer un if

Código PHP:
<?php
$consulta
="select Estado from amigos where id_amigo='$reg[id]' and id_logueado='$id_usuario'";
$ejecuta=mysql_query($consulta) or  die("Problemas en el select:".mysql_error());
$cantidad=mysql_num_rows($ejecuta);
if(
$cons=mysql_fetch_array($ejecuta))

    {  
       echo 
'<div class="amigos">
                <form action="agregara.php" method="post">
                    <input type="hidden" name="id" value="'
.$reg['id'].'">
                    <input type="submit" value="Agregar Amigos">
                </form>
            </div>'
;

    }
    else
    {
        echo 
"Ya enviaste la solicitud";
    }

?>
nose si es muy perfecto pero a mi me soluciono el problema se me olvido ponerlo antes perdon.