mysql_num_rows () argüman geçerli değil

2 Cevap php

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/ango/public_html/ficha/findUser.php on line 201

Bu kodu:

$query = mysql_query("SELECT ango_turnos.planilla.fecha_turno, ango_turnos.planilla.cod_estado, ango_personas.dominio_interno.* FROM ango_turnos.planilla RIGHT OUTER JOIN ango_turnos.reserva ON ango_turnos.reserva.id_turno = ango_turnos.planilla.id_turno LEFT OUTER JOIN ango_turnos.paciente ON ango_turnos.reserva.id_reserva = ango_turnos.paciente.id_reserva LEFT OUTER JOIN ango_personas.dominio_interno ON ango_turnos.paciente.id_persona = ango_personas.dominio_interno.id_persona LEFT OUTER JOIN ango_turnos.horario_medico ON ango_turnos.planilla.id_horario = ango_turnos.horario_medico.id_horario");

if(mysql_num_rows($query)>0){
    while($row = mysql_fetch_array($query)){
        //echo some stuff from $row
    }
}

There is no warning or error involving the connection to the database. This is the only warning I get. SQL query works fine and returns 4 rows in PHPMyAdmin, so I don't know what the problem is.