Odium
01-31-2006, 07:52 PM
For some odd reason I cannot get this script to update the sql database. I have one that inserts and deletes records with no problem, but i must be missing something here. I added the variable's at the bottom to make sure the correct data is being submited correctly, and it looks correct as far as I can tell.
Sorry, im very new at this.
Any word of advise, or an easier way to perform an update would be great.
Thanks.
<?
$ud_id=$_POST['id'];
$ud_mob=$_POST['mob'];
$ud_lockout=$_POST['lockout'];
$ud_tier=$_POST['tier'];
$DBuser = "user";
$DBpass = "pass";
$DBName = "dbname";
$table = "dbtable";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
$sqlquery="UPDATE '$table' SET mob='$ud_mob', lockout='$ud_lockout', tier='$ud_tier' WHERE id='$ud_id'";
$results = mysql_query($sqlquery);
mysql_close();
echo "Record Updated";
echo "<br>";
echo "$ud_id";
echo "<br>";
echo "$ud_mob";
echo "<br>";
echo "$ud_lockout";
echo "<br>";
echo "$ud_tier";
echo "<br>";
?>
Sorry, im very new at this.
Any word of advise, or an easier way to perform an update would be great.
Thanks.
<?
$ud_id=$_POST['id'];
$ud_mob=$_POST['mob'];
$ud_lockout=$_POST['lockout'];
$ud_tier=$_POST['tier'];
$DBuser = "user";
$DBpass = "pass";
$DBName = "dbname";
$table = "dbtable";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
$sqlquery="UPDATE '$table' SET mob='$ud_mob', lockout='$ud_lockout', tier='$ud_tier' WHERE id='$ud_id'";
$results = mysql_query($sqlquery);
mysql_close();
echo "Record Updated";
echo "<br>";
echo "$ud_id";
echo "<br>";
echo "$ud_mob";
echo "<br>";
echo "$ud_lockout";
echo "<br>";
echo "$ud_tier";
echo "<br>";
?>