$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!

Recommended Answers

All 3 Replies

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());

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.