ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-spanish
php-spanish
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved