From: Alejandro M. S. \( A. \) <al...@ad...> - 2006-03-26 17:10:41
|
Hi Renne : <?php $db =3D3D NewADOConnection($database_type); $db-> Connect($host, $user, $password, $database); $sSql =3D "SELECT * FROM usuarios WHERE usuarios.str_usuario =3D3D '".$str_usuario."'"; $rs =3D $db->Execute( $sSql ); if( !$rs ) { print $db->ErrorMsg().'<BR>'; return false; } else { $rs->RecordCount() } return true; ?> RecordCount is Resultset properti, not a connection properti. Try this. Alejandro Michelin Salomon Porto Alegre Brasil -->-----Mensagem original----- -->De: ado...@li...=20 -->[mailto:ado...@li...] Em nome=20 -->de ado...@li... -->Enviada em: domingo, 26 de mar=E7o de 2006 01:02 -->Para: ado...@li... -->Assunto: ADodb-general digest, Vol 1 #107 - 1 msg --> --> -->Send ADodb-general mailing list submissions to --> ado...@li... --> -->To subscribe or unsubscribe via the World Wide Web, visit --> https://lists.sourceforge.net/lists/listinfo/adodb-general -->or, via email, send a message with subject or body 'help' to --> ado...@li... --> -->You can reach the person managing the list at --> ado...@li... --> -->When replying, please edit your Subject line so it is more=20 -->specific than "Re: Contents of ADodb-general digest..." --> --> -->Today's Topics: --> --> 1. Problem with RecordCount function (Renne Rocha) --> -->--__--__-- --> -->Message: 1 -->Date: Sat, 25 Mar 2006 17:27:36 -0300 -->From: "Renne Rocha" <ren...@gm...> -->To: ado...@li... -->Subject: [ADodb-general] Problem with RecordCount function --> --> Hello, --> --> I am trying to use ADODB to access a PostgreSQL 8.1.2=20 -->database. e connection works well. But after using a select=20 -->query I tried to get the number of the rows in the result. I=20 -->use the function RecordCount, but I receive an error message=20 -->saying that this function doesn't exist. --> --> I searched on the internet, but I found that postgres=20 -->permit the use of this function. What could I do to solve=20 -->this problem? --> --> A piece of my code: --><?php --> $db =3D3D NewADOConnection($database_type); --> $db-> Connect($host, $user, $password, $database); --> $query =3D3D "SELECT * FROM usuarios WHERE=20 -->usuarios.str_usuario =3D3D '".$str_usuario."'"; --> if($db->Execute($busca) =3D3D=3D3D=3D3D false) --> { --> print $db->ErrorMsg().'<BR>'; --> return false; --> } else --> { --> if($db->RecordCount()=3D3D=3D3D0) { return false; } --> return true; --> } -->?> --> --> The error message: --> Fatal error: Call to undefined function: recordcount() in=20 -->/srv/www/htdocs/class.usuario.php on line 60 --> --> Thanks for any help. --> --> Renne --> --> --> -->--__--__-- --> -->_______________________________________________ -->ADodb-general mailing list -->ADo...@li... -->https://lists.sourceforge.net/lists/listinfo/adodb-general --> --> -->End of ADodb-general Digest --> --> -->--=20 -->No virus found in this incoming message. -->Checked by AVG Free Edition. -->Version: 7.1.385 / Virus Database: 268.3.1/292 - Release=20 -->Date: 24/3/2006 --> --> -->--=20 -->No virus found in this incoming message. -->Checked by AVG Free Edition. -->Version: 7.1.385 / Virus Database: 268.3.1/292 - Release=20 -->Date: 24/3/2006 -->=20 --> --=20 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.3.1/292 - Release Date: 24/3/2006 =20 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.3.1/292 - Release Date: 24/3/2006 |