0

$sql = "UPDATE USERS SET password='changed password' WHERE login = steve";

header( 'Location: http://steveworld.000space.com/prof.php' );

this is my code, im trying to allow users to change their passwords at anytime, I put in a set text and it still doesnt work, it is very agitating!

Edited by thesyntax: n/a

3
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by spankyxeon
0

You need to have single quotes around login value like

$sql = "UPDATE USERS SET password='changed password' WHERE login = 'steve'";

In such cases, always use mysql_error() after mysql_query to debug issues like

$sql = "UPDATE USERS SET password='changed password' WHERE login = 'steve'";
mysql_query($sql) or die ("Error in query. Error: ".mysql_error());
0

You need to have single quotes around login value like

$sql = "UPDATE USERS SET password='changed password' WHERE login = 'steve'";

In such cases, always use mysql_error() after mysql_query to debug issues like

$sql = "UPDATE USERS SET password='changed password' WHERE login = 'steve'";
mysql_query($sql) or die ("Error in query. Error: ".mysql_error());

ok, thanks seems to have worked

0

Can you update a field like this

$updateQuery="update {$db->config[prefix]}".$_REQUEST['table']." set 
				Gen_date='0000-00-00',
				member_id='',
				payment_id='',
				product_id='',
				where payment_id='".$_REQUEST['prev_id']."'";

of course prev_id is a form value.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.