Forums

PHP

This topic is locked

Registration tutorial part 3

Posted 22 Aug 2006 10:19:23
1
has voted
22 Aug 2006 10:19:23 Nick Beckett posted:
I have been using the DMX tutorials to develope site registration, login and confirmation pages. All is going well except for one piece of script which does nto seem to work. This is as follows:

<?php require_once('../Connections/connection_reg.php'); ?>
<?php
if (isset($_GET["user_id"])) {
$updateSQL = sprintf("UPDATE users SET user_level=0 WHERE user_id=%s",$_GET['user_id']);

mysql_select_db($database_connection_reg, $connection_reg);
$Result1 = mysql_query($updateSQL, $connection_reg) or die(mysql_error());
}
header("Location: users.php";
?>

This script is supposed to tell MySql database that the user_level of a particular user id in the database should change to 0. This code is executed from a a page which shows which users have and havnt confirmed thire registration details. The idea is that someone can change a conirmed user with a user level code of 1 to an unconfirmed user with a user level of 0

I dont get any error message when I run the code. It just appears that the database is not being updated. The user_level is not being updated to 0

Has anyone used this script and had the same problem? I am using MySql 5.0?

Many Thanks







Reply to this topic