SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    ********* Addict DLG_1's Avatar
    Join Date
    Jun 2000
    Location
    Texas, USA
    Posts
    597
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is my code:
    Code:
    			$sql 			= "SELECT * FROM security WHERE security.mbr_no = '$id'";
    			$sql_result 	= mysql_query($sql, $connection) or die ("Couldn't query security table");
    			$found            = mysql_numrows($sql_result);	
    				if ($found != 0){
    				while ($broker_row = mysql_fetch_array($sql_result)){
    						 	$password			= $broker_row["password"];
    					 }
    				}		
    			if ($oldPassword == $password){
    						if ($newPassword == $newPassword2){
    						$sql 			= "UPDATE security SET password = '$newPassword' WHERE security.mbr_no = '$id'";
    						$sql_result 	= mysql_query($sql, $connection) or die ("Couldn't query security table-2");
    						echo "password has been changed.";	
    						}		
    						else 
    							echo "new passwords don't match.";
    					}
    			else if ($oldPassword != $password){
    				echo "$oldPassword - $password Sorry, but the old password doesn't match the password on the account.";
    				}			
    ?>
    this is my code on drugs:


    any questions?


    j/k



    this is some weird problem because I'm trying to let the client sign-in and change their password; however, when I'm comparing the OLD PASSWORD with the new they always don't match!!! WHAT'S THE DEAL?

    the text length in the html form is 12 and in the dB it is varchar(12) as well! can someone please help me?!?!!?!?!?


    THanks,

    DLG_1

  2. #2
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Define password as varchar(16). I think it works.

    John

  3. #3
    ********* Addict DLG_1's Avatar
    Join Date
    Jun 2000
    Location
    Texas, USA
    Posts
    597
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope. i was uploading the files using "" to enclose some fields. after I took the "" off then it worked!


    yipee!


    Sam

  4. #4
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For some reasons, the Password field in table user of mysql Database is defined as char(16)... don't know why.

    John


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •