jjjhbj111 wrote:
> Hi I know Dreamweaver allow you to check for duplicate
usernames but I would
> also like to be able to check for passwords.
It's not really necessary because the combination of the
username and
password will still be unique. However, if you want to do it,
you simply
need to create a recordset that uses the password as a
filter.
Dreamweaver recordsets automatically create a variable that
contains the
number of rows in the recordset. It's in the final line of
the recordset
code, and looks like this:
$totalRows_recordsetName = mysql_num_rows($recordsetName);
You can then wrap the insert record code in a conditional
statement like
this:
if ($totalRows_recordsetName > 0) {
$duplicatePass = 'Please choose a different password';
}
else {
// insert record code goes here
}
In the main body of the form:
if (isset($duplicatePass)) echo $duplicatePass;
--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/