Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: mjlindleyPosted on 2002-09-07 at 02:23:58ID: 7268823
I would have thought that you could do it via a standard MySQL query (assuming that you have suitable rights on the database).
"username", "password") or die("Can't connect to db.");
Try something like: (I don't have MySQL on this PC but I'm sure you could check out the tables in the "mysql" database. I've not tested this code so you might have to make small alterations other than entering the usernames and password you need.
<?
// set up db connection
$connection = mysql_connect("localhost",
$db = mysql_select_db("mysql", $connection) or die("Can't select db");
// define query
$sql = "UPDATE users SET password = \"new_password\" WHERE user = \"username\"";
// do query
if ($result = mysql_query($sql, $connection)) {
echo "Updated password";
} else {
echo "Update failed:<br><br>" . mysql_error();
}
?>
I hope this helps,
M@