-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all
I'm pulling out hair here. this snippet of code seems to work just great
but when I use it in the method 'change_password()' it gives me access
denied errors. I see nothing wrong with the php but maybe someone can
help me?
Here is the connect code:
function _db_connect() {
$con=mysql_connect($this->host, $this->user,
$this->pass) or die("Could not connect. Please try later");
if(!$con) {
return FALSE;
}
$db=mysql_select_db($this->db) or die ("can't select db");
return TRUE;
}
and here is the method it fails in:
function change_password($email, $new_password) {
$new_password=md5($new_password); // encryption
$qry="UPDATE $this->table SET pass = '$new_password' ";
$qry.="WHERE email = '$email'";
if(!$this->_db_connect()) {
return FALSE;
}
if(!($result=mysql_query($qry))) {
return FALSE;
} else {
if(mysql_affected_rows()==0) {
return FALSE;
} else {
$this->set_pass($new_password);
}
}
return TRUE;
}
many thanks...
- --
Nick Wilson // www.explodingnet.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
iD8DBQE83RXqHpvrrTa6L5oRAlcYAKCbmu0AsKiWDCAKAKZ5apgFOWTu5ACfVNET
mdPCeea2Nt8oEzoQ+onBCXo=
=OHBS
-----END PGP SIGNATURE-----
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php