UPDATE command (php/mySQL)

I need some help in implementing the UPDATE command. I can’t figure out why it isn’t working. The point is to update the values in the database from values submitted in a form. Here’s my code, I would greatly appreciate it if someone could tell me what is wrong with it. I know that it is executing because it prints out the echo.


	if($theName) {
		
	$query = "UPDATE orders SET address='$address', city='$city', state='$state', zip='$zip', phone='$phone', birthdate='$birthdate', lastPresc='$prescDate', lastOrder='$lastOrder', rtBrand='$rtBrand', ltBrand='$ltBrand', rtBaseCurve='$rtBaseCurve', rtDiameter='$rtDiameter', ltDiameter='$ltDiameter', rightPower='$rtPower', leftPower='$ltPower') WHERE username='$theName'"; 
	$result = mysql_query($query);
	
	echo "<i>$theName's data was updated successfully.</i><br><br>";