0

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
  • End what is the value of entry_table variable? – Krzysiek Dróżdż Jan 27 at 13:22
  • @KrzysiekDróżdż I forgot to add that part. $entry_table = GFFormsModel::get_entry_table_name(); – Hamed Najafi Jan 27 at 13:27
  • And entry['id']? – Krzysiek Dróżdż Jan 27 at 13:28
  • I did it by using the plugin "GravityView". Thanks for the great help. – Hamed Najafi Jan 28 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.