Jump to content

Update not working - can't find any errors ...


Jax2

Recommended Posts

Hi all...

 

I'm kind of perplexed here. I've been writing simple sql queries for quite a long time now and I've never run into one not working that I couldn't find an error in, usually a typo, until now.

 

Here is the code:

 

$new_enc=md5($new1); // password - new, encrypted to MD5.
$sql2="UPDATE host_locations SET passwd=".$new_enc." where location_id=".$_SESSION['SESS_LOCATION_ID']."";
echo $sql2;
$result2=mysql_query($sql, $db) or die(mysql_error());

 

When I echo the statement, it returns the following:

UPDATE host_locations SET passwd=a8687181f3a5a793608acd2215d83a49 where location_id=3

which is exactly right. Yet, for some odd reason, the database isn't storing the new password. I've triple checked my variables, they're correct, and I'm getting the location_id so I know I am connecting correct.

 

mysql_error is returning no errors either.

 

Any suggestions?

 

Link to comment
https://forums.phpfreaks.com/topic/199538-update-not-working-cant-find-any-errors/
Share on other sites

Yes, the update command works perfectly ... it updated the right record as it should have.

 

Which makes this even more confusing to me because I know my sql connection is correct, because if I enter the incorrect current password, it tells me that I used the wrong current, so I know it's connecting. I am using the same query style for both.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.