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

hice un if pero no me sale el boton por que no me sale este es el codigo:
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);
while(
$cons=mysql_fetch_array($ejecuta))
{
    if(
$cantidad=="0")
    {  
       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";
    }
}
?>
Gracias lo otro ya funciona era la comilla jeje.