Grab Value from Ajax and Handle with Php and Update row

I am trying to get jquery’s .ajax() to send values sent to a form :



    					<form method="post" id="FanDetail">
    						<label for="bio">Brief Bio<br /></label>
    							<textarea id="bio" name="fan_bio" cols="27" rows="3"></textarea><br />
    						<label for="dob">Date of Birth<br/></label>
    							<input id="dob" name="fan_dob" value="(e.g. 01/05/1965)" onFocus="clearText(this)" /><br />		
    						<label for="zip">Location<br /></label>
    							<div class="ui-widget">
    								<input id="zip" name="term" value="What is your Zipcode?" onFocus="clearText(this)" /><br />
    								<input id="actualZip" type="hidden" name="actualzipval" value="" />
    							</div><!--ui-widget :: zip -->
    						<label for="occup">Occupation<br /></label>
    							<div class="ui-widget">
    								<input id="occup" type="text"  name="term2" value="e.g. Computer Programmer, etc" onFocus="clearText(this)" /><br />
    								<input id="actualOccup" type="hidden" name="actualOccupval" value="" />
    							</div><!--ui-widget :: occup -->
    						<label for="fbkurl">Facebook Handle&nbsp;[?]<br /></label>
    							<input id="fbkurl" type="text"  name="fan_fbk" value="e.g. SportsFan12" onFocus="clearText(this)" /><br />
    						<label for="twiturl">Twitter Handle&nbsp;[?]<br /></label>
    							<input id="twiturl" type="text"  name="fan_twit" value="e.g. AboutSports2012" onFocus="clearText(this)" /><br />
    						<label for="phoNum">Phone Number<br /></label>
    							<input id="phoNum" type="text"  name="fan_pho" value="cell or home phone" onFocus="clearText(this)" /><br />
    					<input style="background-image:url('img/save.png');" type="submit" name="saveAbout" value="" id="submit" />
    					</form>
    <div class="success" style="display:none;">Got it!</div>

This HTML connects to the JS file `submitvalues.js


    //////////////// About Tab
    $(document).ready(function(){
    	$("form#FanDetail").submit(function() {
    	// store the values from the form input box, then send via ajax below
    	var bio = $('#bio').val();
    	var dob = $('#dob').val();
    	var zip = $('#actualZip').val();
    	var occup = $('#actualOccup').val();
    	var fbkurl = $('#fbkurl').val();
    	var twiturl = $('#twiturl').val();
    	var phoNum = $('#phoNum').val();
    	$.post(
                "../src/php/registration/about/submitvalues_about_tab.php",
                $("form#FanDetail").serialize(),
                function(){
                    $('form#FanDetail').hide(function(){
                        $('div.success').fadeIn();
                });
              });
           return false;
        });
    });

This JS file, then connects to a php script that sends them to mysql via PDO
UPDATED PHP:

  ///////////////////////////////////////////////
######## Get  Input to Submit ############## //
///////////////////////////////////////////////
$fanBio = $_POST['bio'];		     //////
$fanDob = $_POST['dob'];		     //////
$zipval = $_POST['zip'];	 		 //////
$occupval = $_POST['occup'];		 //////
$facebookurl = $_POST['fbkurl'];	  	 //////
$twitterurl = $_POST['twiturl'];    	 //////
$phoneNum = $_POST['phoNum'];		 //////
//$fanID = 1;
///////////////////////////////////////////////

try{
	## Get current user and their session ID:
	$sessionvar = session_id();
	### DB Connection already established above.
	$dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );  
	// INSERT CLEAN DATA INTO TABLE&#8230;
	$sth = $dbh->prepare("
	UPDATE Fan 
	SET fanBio=?,fanDob=?,fanDetLocID=?,occupID=?,fanFbk=?,fanTwit=?,fanPho=?
	WHERE fanID = 1
	");
	
	/*
	
	$calories = 150;
    $colour = 'red';
    $sth = $dbh->prepare('SELECT name, colour, calories
    FROM fruit
    WHERE calories < :calories AND colour = :colour');																							
    $sth->execute(array(':calories' => $calories, ':colour' => $colour));
	
	
	*/
	
	$sth->bindParam(1,$fanBio);
	$sth->bindParam(2,$fanDob);
	$sth->bindParam(3,$zipval);
	$sth->bindParam(4,$occupval);
	$sth->bindParam(5,$facebookurl);
	$sth->bindParam(6,$twitterurl);
	$sth->bindParam(7,$phoneNum);
	//$sth->bindParam(8,$fanID);
	$sth->execute(array($fanBio,$fanDob,$zipval,$occupval,$facebookurl,$twitterurl,$phoneNum/*,$fanID*/));
	$sth->debugDumpParams(); ## debugging query
} 
 

[B]Error I’m getting: None. It says after I fill in all the

`input`s `Got it!`

and thus it had fired off the .success class.

I tried:[/B]

  • Manually entering in this information via mysql - works fine.
  • Running Javascript Console to debug, it is sending it fine on the JS end, since I get this, once I click the send button:

When I fill in the input and look at the JS Console under Network->Response I get on the PHP FILE:


       SQL: [107] 
    	UPDATE Fan 
    	SET fanBio=?,fanDob=?,fanDetLocID=?,occupID=?,fanFbk=?,fanTwit=?,fanPho=?
    	WHERE fanID = 1
    	
    Params:  7
    Key: Position #0:
    paramno=0
    name=[0] ""
    is_param=1
    param_type=2
    Key: Position #1:
    paramno=1
    name=[0] ""
    is_param=1
    param_type=2
    Key: Position #2:
    paramno=2
    name=[0] ""
    is_param=1
    param_type=2
    Key: Position #3:
    paramno=3
    name=[0] ""
    is_param=1
    param_type=2
    Key: Position #4:
    paramno=4
    name=[0] ""
    is_param=1
    param_type=2
    Key: Position #5:
    paramno=5
    name=[0] ""
    is_param=1
    param_type=2
    Key: Position #6:
    paramno=6
    name=[0] ""
    is_param=1
    param_type=2