Jump to content

Problem with SQL query UPDATE


joecooper

Recommended Posts

<?php
session_start();
include("db.php");
echo "Your username:$username, Your key:$key";
mysql_query("UPDATE users SET active='yes' WHERE key='$key'");
?>

i have this code, the db.php file is fine, the $key and $username varibles come from the link, that allworks, but it doesnt want to update the feild "active". the keys match ect. im not sure what to try
Link to comment
https://forums.phpfreaks.com/topic/4719-problem-with-sql-query-update/
Share on other sites

[!--quoteo(post=354059:date=Mar 12 2006, 01:40 AM:name=joecooper)--][div class=\'quotetop\']QUOTE(joecooper @ Mar 12 2006, 01:40 AM) [snapback]354059[/snapback][/div][div class=\'quotemain\'][!--quotec--]
argh! i really should use a prefix for all my scripts
[/quote]

if you're going to use a reserved word.. you could encapsulate it like

[code]select * from users where [key] = '1'[/code]

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.