Using If/Else or Conditional Logic with gform_after_submission

Can anyone point me to a site that could help me learn how to add a conditional statement into php for my gforms_aftermission hook in gravity forms

I use the code below to send submissions to a MySQL database, this works fine on every submission but now I’d like it to work only if a formfield result equals specific text.

Like a If statement in Excel, If X = Y then gforms_aftermission if not take no action

add_action("gform_after_submission_99", "go_contact", 10, 2);
function go_contact($entry, $form){

$First_Name = $entry["5.3"];

$con=mysqli_connect("***IP Address**","**Username**","**Password**","**Database Name**");

mysqli_query($con,"INSERT INTO trs_contact (First_Name) VALUES ('$First_Name')");
} 

Any help/input would be appreciated.

Thanks

Hi Dan. You can add a conditional like this:

add_action( "gform_after_submission_99", "go_contact", 10, 2 );
function go_contact( $entry, $form ){
	GFCommon::log_debug( __METHOD__ . '(): The Entry => ' . print_r( $entry, true ) );
	// run this code is the value in field 22 of the entry equals "My Value"
	if ( rgar ( $entry, '22') == 'My Value' ) {
		GFCommon::log_debug( __METHOD__ . '(): Value matched: running.' );
		$First_Name = $entry["5.3"];
		$con=mysqli_connect("***IP Address**","**Username**","**Password**","**Database Name**");
		mysqli_query($con,"INSERT INTO trs_contact (First_Name) VALUES ('$First_Name')");
	}
}