Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

php + check password duplicate in database

Guest
Dec 18, 2006 Dec 18, 2006

Copy link to clipboard

Copied

Hi I know Dreamweaver allow you to check for duplicate usernames but I would also like to be able to check for passwords.
I tried following the same as the username but it disregards it.
Any suggestions?
Thanks for your time.
TOPICS
Server side applications

Views

246
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 18, 2006 Dec 18, 2006

Copy link to clipboard

Copied

LATEST
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/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines