i've been having lots of troubles (for the past three days), trying to get this to work. i just can't figure out what's wrong with it - i started over from scratch and it still doesn't work. i'm trying to update fields in a database, but there's either a php or an sql error somewhere. this version gives me sql errors, but i can't find any and it's the closest i've gotten. i had one that didn't produce any errors, but didn't do anything, either. anybody see what's gone wrong here?
if(!$stop) {
$dbh = mysql_connect($sqlhost, $sqluser, $sqlpass);
if(!$dbh) {
$email = $admin['email'];
die("<b>Uh hoh! I've encountered an error!</b> Please go <a href='javascript:history.go(-1)'>back</a>, or <a href='mailto:$email'>email us</a> regarding the error. When trying to connect, the MySQL server said: <code>" . mysql_error() . "</code>");
}
$switch = mysql_select_db($sqldb, $dbh); //set the db to the config.php defined value
if(!$switch) {
echo "<b>Uh hoh! I've encountered an error!</b> Please go to <a href='javascript:history.go(-1)>back</a>, or <a href='mailto:$email'>email us</a> regarding the error. When trying to switch databases, the MySQL server said: <code>" . mysql_error();
}
$newencpass = md5($password2);
$query = "UPDATE `user` SET password='$newencpass', name='$fullname' WHERE username = '$username'";
$result3 = mysql_query($query, $dbh);
if(!$result3) {
echo "Error." . mysql_error();
}
mysql_close($dbh);
}