First of all, I’m a beginner at all of this, so I didn’t know if I should post in PHP Beginners or this forum-- please move if appropriate (and I apologize).
So I have a form that needs to update the selected user’s information and then display a page that has all the updated info… Not sure what to fix; when I push submit on the form, I get the specified error code. Any help is appreciated!
[php]<?php
include (“checkadmin.inc”);
include (“dbConnect.inc”);
$con = mysql_connect($localhost_var,$m_userid,$m_password) or die (“Could not connect to database”);
$firstname=$_POST[‘firstname’];
$middleinit=$_POST[‘middleinit’];
$lastname=$_POST[‘lastname’];
$newfirstname=$_POST[‘newfirstname’];
$newmiddleinit=$_POST[‘newmiddleinit’];
$newlastname=$_POST[‘newlastname’];
$newSSN=$_POST[‘newSSN’];
$address=$_POST[‘address’];
$city=$_POST[‘city’];
$state=$_POST[‘state’];
$zip=$_POST[‘zip’];
$newdepartment=$_POST[‘newdepartment’];
$department=$_POST[‘department’];
$email=$_POST[‘email’];
$phone=$_POST[‘phone’];
$gender=$_POST[‘gender’];
$race=$_POST[‘race’];
$rank=$_POST[‘rank’];
$jobno=$_POST[‘jobno’];
$hiredate=$_POST[‘hiredate’];
$spectraining=$_POST[‘spectraining’];
$facility=$_POST[‘facility’];
if ($floridaflag == 1) {
$newpeoplefirst=$_POST[‘newpeoplefirst’];
$peoplefirst=$_POST[‘peoplefirst’];
$certification=$_POST[‘certification’];
}
else {
$certification=“NA”;
$newpeoplefirst="";
}
$usertype=$_POST[‘usertype’];
$district=$_POST[‘district’];
$status=$_POST[‘status’];
$inuserid=$_POST[‘inuserid’];
$inusertype=$_POST[‘inusertype’];
$updateuser = (“update INDIVIDUALS set firstname=’$newfirstname’, middleinit=’$newmiddleinit’, lastname=’$newlastname’, SSN=’$newSSN’, address=’$address’, city=’$city’, state=’$state’, zip=’$zip’, department=’$newdepartment’, email=’$email’, phone=’$phone’, gender=’$gender’, race=’$race’, rank=’$rank’, jobno=’$jobno’, hiredate=’$hiredate’, spectraining=’$spectraining’, facility=’$facility’, peoplefirst=’$newpeoplefirst’, certification=’$certification’, usertype=’$usertype’, district=’$district’, status=’$status’, usertype=’$inusertype’ WHERE userid=’$inuserid’”);
$updateresult = mysql_query($updateuser);
if ($updateresult) {
header(“Location: updatedcoreuser.php”);
exit;
}
else {
print “<div class=“attentionText”>Error in update.”;
}
?>[/php]