I am exporting the entry data into a table, trouble is, any entry that has an apostrophe in the name (O'Donnel) does not come thru. Error log showing name field as 'O'Connor'
I assume that the apostrophe needs to be escaped - but I cannot figure how to do it. Would I do it in the hook in the functions.php file?:
// Pulls gravity form entries into xml and outputs
add_action('gform_after_submission_6', 'input_fields', 8, 4);
function input_fields($entry, $form){
global $wpdb;
$promocode = $entry['7'];
$conferenceid = $entry['6'];
$conferencechoice = $entry['1'];
$firstname = $entry['2.3'];
$lastname = $entry['2.6'];
$phone = $entry['3'];
$email = $entry['4'];
$optinternal = $entry['5.1'];
$optexternal = $entry['5.2'];
$SQL = "INSERT INTO fsleads ( userid, promocode, conferenceid, conferencechoice, firstname, lastname, phone, email, optinternal, optexternal, uploaded ) VALUES ( '', '$promocode', '$conferenceid', '$conferencechoice', '$firstname', '$lastname', '$phone', '$email', '$optinternal', '$optexternal' , 'N' )";
$wpdb->query($SQL);