Re: encontrar un elemento anterior y posterior
| From: | Pablo Rodríguez | Date: | Mon, 16 Jan 2006 12:57:25 +0000 |
| Subject: | Re: encontrar un elemento anterior y posterior | ||
| References: | 1 2 3 4 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-57348@lists.php.net to get a copy of this message | ||
Desde el mensaje anterior, he descubierto algo que me ha sorprendido. Tengo el siguiente código:
$sqlant = "SELECT * FROM projects WHERE claveproy < \"" . $location ."\" LIMIT 0,1;" or die(mysql_error());
$claveant = mysql_query($sqlant, $link) or die(mysql_error());
if ($claveant = "") {$cuantosant = 0;} else {$cuantosant = mysql_num_rows($claveant) or die(mysql_error());
$datosant = mysql_fetch_row($claveant) or die(mysql_error());}
Me da error en todas las páginas:
"mysql_num_rows(): supplied argument is not a valid MySQL result resource"
¿Cómo tengo que hacer el condicional para que si $claveant no tiene salida funcione y para que mysql_num_rows y my_fetch_row no me den error?
Muchas gracias,
Pablo