Mysql Error in querying form entries in Gravity Form plugin

admin2025-06-04  2

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
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748971020a315265.html

最新回复(0)