[PHP-ES] Duda con mysql_fetch_row
by Johnny Sanchez other posts by this author
Jun 20 2006 7:39AM messages near this date
RE: [PHP-ES] Tipo de variable para una imagen
|
Re: [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 algu
n campo no se repita, y en este caso he seleccionado el numero de identidad, entonces para e
llo 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:\web
site\site\infomision\forms\datpers.php on line 459
siendo la linea 459 : if ($registro = mysql_fetch_row($result)) $errstr = $errstr . "Ya exis
te ese registro";
Espero me puedan ayudar.
Saludos.
Johnny
Thread:
Johnny Sanchez
Mario Sanchez
Johnny Sanchez
Satyam
Johnny Sanchez
|