Jump to content

I can`t see where the problem is - Updating a field in the database table


djfox

Recommended Posts

settings.php

<?php
//Date: September 13 2007
//For: secrettrance.net
//Description: Manage Profile: Update Settings

session_start();
include("dbcon.php");
include("func.php");
require_once "design.php";
require_once "auth.php";
require_once "includes/defines.php";

$id = $_SESSION['gal'];
$lev=$_SESSION['level2'];

$Title = "Secret Trance: Manage Profile: Update Settings";

require_once "header.php";
require_once "hidestatus.php";

if (!isLoggedIn()) {
Redirect("index.php");
}
?>

<table border=0 width=100%><? //1 
?>
<tr>
<td>
<table border=0 width=100% bgcolor="000000"><? //2
?>
<tr>
<td background="<? echo "$boxbanner"; ?>"><b>Manage Profile: Update Settings</b>
<tr>
<td background="<? echo "$boxback"; ?>">
<?php
if( $lev > 0){
if( $suspend < 1){
$res = mysql_query("SELECT adult FROM userdata WHERE id='$id'");
$rows = mysql_fetch_row($res);
mysql_free_result($res);
?>
<blockquote>
<font size=2><i>Change settings at your own risk. Secret Trance is not held respnsible for anything that could happen when any part of the settings are altered. By setting adult rating to "Adult/Mature", you are verifying that you are at least 18 years of age to view such content.</i></font>
</blockquote>
<form action="settings2.php">
<b>Adult Rating:</b>
<br><select name="adult" style="border: 0px; background-color:#000000; color: #B6ABCE;">
<option value="0">Up to PG-13</option>
<option value="1">Adult/Mature Content</option>
</select>
<p>
<?
echo "<input type='hidden' name='id' value='$id'>"; 
echo "<input type='submit' name='submit' value='Update Settings'>";
?>
</form>
<?php
}
else {
if( $suspend > 0){
echo "Sorry, your account is on suspension. You must wait until suspension expires before you can access this.";
}
}
}
?>
</table><? //2
?>
</table><? //1 
?>
<p>
<? require("footer.php"); ?>

 

settings2.php

<?php session_start();
include("dbcon.php");
include("auth.php");

//Date: September 13 2007
//For: secrettrance.net
//Description: Update Settings

if (!isLoggedIn()) {
Redirect("index.php");
}
$id = $_SESSION['gal'];

mysql_query("UPDATE userdata SET adult='$adult' WHERE id=$id");
mysql_close($con);
//redirect
header("Location: manageprofile.php");
?>

 

It`s more or less the same codes I used to update other fields in databases but for some reason this one will not work. It will not update the adult field. It keeps leaving it at 1.

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.