Hi,
I have an edit form whose fields are supposed to make changes in a corresponding database. Instead of assigning the new variables, it just wipes the fields clean. I've tried it both with and without the block that starts:
$prof_id=$POST['prof_id'];
$f_name=$POST['f_name'];
$mi=$_POST['mi'];
I wasn't sure if I needed that or if the UPDATE does that, but mine's not working either way.
Any ideas about what's wrong? Here's the first part:
if( isset($_POST['submit']) ){
$prof_id=$_POST['prof_id'];
$f_name=$_POST['f_name'];
$mi=$_POST['mi'];
$l_name=$_POST['l_name'];
$credentials=$_POST['credentials'];
$phone=$_POST['phone'];
$address=$_POST['address'];
$city=$_POST['city'];
$state=$_POST['state'];
$zip=$_POST['zip'];
$fax=$_POST['fax'];
$email=$_POST['email'];
etc.
Then there's some validation stuff, then here's the SQL:
$sql = "UPDATE professional SET prof_id='$prof_id', f_name='$f_name', mi = '$mi', l_name='$l_name', credentials='$credentials', phone='$phone', address='$address', city='$city', state='$state', zip='$zip', fax='$fax', email='$email' WHERE prof_id='".$_GET['prof_id']."'";
Can anyone see what's happening? And can someone explain about the
$prof_id=$POST['prof_id'];
$f_name=$POST['f_name'];
$mi=$_POST['mi'];
block? Do I need that or not?