This is my code.
<?php
global $wpdb;
$entry_table = GFFormsModel::get_entry_table_name();
$sql = $wpdb->prepare( "SELECT * FROM {$entry_table} WHERE id=%d", $entry['id'] );
$current_properties = $wpdb->get_row( $sql, ARRAY_A );
foreach ( $current_properties as $key => $property ) {
if ( ! isset( $entry[ (string) $key ] ) ) {
$entry[ (string) $key ] = $current_properties[ $key ];
}
}
?>
I want to run this query and list form entries of Gravity form. But this is what I get.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1