Re: counting records in db

From: Date: Thu, 26 Oct 2006 18:16:05 +0000
Subject: Re: counting records in db
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-243697@lists.php.net to get a copy of this message
Would it be ok to use the same code to check if customer is loged in? $query = mysql_query(" SELECT COUNT(Username) as NoOfRecords FROM customers WHERE Username = '$Username' AND Password = '$Password'"); if (mysql_result($query, 0) == 0) { echo 'Please try again'; } else { header('location: index.php); exit; }

« previous php.general (#243697) next »