The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

A code into MySQL db

I have a site where people get a code and then they have to confirm that code and will be directed to a web page via sms along with that code in the URL.

The URL includes $nr and $code

So, when they go to that specific page I wanna update their field in my db, so their status is set to one and the code and number are also inserted in their field.
But when I did the following code, the first id was updated and not the second, which is the one I was trying.

So, can anyone see what's wrong in my very short script here?

PHP Code:

<?php
error_reporting(0);

include("incl/sql.php");

$nr = $_REQUEST["nr"];
$code = @urldecode($_REQUEST["code"]);

sqlconnect();

mysql_query("UPDATE table SET nr='$nr', status=1, reg_date=now() WHERE code='$code'") or die(mysql_error());

Well, the script is looking through the table for the field with the same $code and then it should update the status field and change the zeros in reg_date and nr.
In the field I have name, adress and so on from before. So I need to change the status and insert the registration date and the number from this line.