Re: [PHP-ES] Duda con mysql_fetch_row
by Mario Sanchez other posts by this author
Jun 20 2006 7:54AM messages near this date
[PHP-ES] Duda con mysql_fetch_row
|
Re: [PHP-ES] Duda con mysql_fetch_row
El problema es que no te da resultados y por eso "te canta" ese error.
Cambia esta linea:
$ssql=("select ci from datpers wherer ci='".ci."' ");
por esto:
$ssql=("select ci from datpers where ci='".ci."' ");
Creo que ese error de MYSQL es todo el problema.
Ya cuentas, Saludos!
----- Original Message -----
From: "Johnny Sanchez" <johnny@[...].cu>
To: "php" <php-es@[...].net>
Sent: Tuesday, June 20, 2006 6:37 PM
Subject: [PHP-ES] Duda con mysql_fetch_row
Hola listeros, tengo la siguiente duda.
Estoy creando una aplicacion y bueno, para poder entrar los registros debo
comparar que algun campo no se repita, y en este caso he seleccionado el
numero de identidad, entonces para ello use la siguiente sintaxis:
//Chequear el carne de identidad
$ssql=("select ci from datpers wherer ci='".ci."' ");
$result=mysql_query($ssql);
if ($registro = mysql_fetch_row($result)) $errstr = $errstr . "Ya
existe ese registro";
// Concluir
if ($errstr!="") {
echo("$errstr");
mysql_close();
}
la variable $errstr es una variable que puse a cero(0)
entonces cuando ejecuto primeramente me da un error y no me cierra la
coneccion:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in C:\website\site\infomision\forms\datpers.php on line 459
siendo la linea 459 : if ($registro = mysql_fetch_row($result)) $errstr =
$errstr . "Ya existe ese registro";
Espero me puedan ayudar.
Saludos.
Johnny
--
PHP Spanish Localization Talk Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Johnny Sanchez
Mario Sanchez
Johnny Sanchez
Satyam
Johnny Sanchez
|