title: Unknown column 'value' in 'where clause'
body: <p>I have reviewed every post and tried a few recommendations but nothing is working. My code has been fine -- but Gravity Forms did an update and messed up the database tables the data was pulling from so I edited that but the data is still not pulling properly and I am getting the error: Unknown column 'value' in 'where clause' when I turn on debug. </p>
  
  <p>Can anyone see why I am getting this error? The page should be retrieving a list of team members based on the value they have entered in a graavity form field.....all was fine until the update. </p>
  
  <p>Here is the code that is causing the issues - specifically the $get_team_ids and $user_email lines seem to be the offenders.</p>
  
  <pre><code>function showstep1(){
  $concate='';
  $postid = get_the_ID();
  $post_7 = get_post($postid); 
  
  if( is_mr() ) {
  //print_r($post_7-&gt;post_title);
   }
  //echo $postid;
  
  global $wpdb;
  $table_name = $wpdb-&gt;prefix . "walking_steps";
  $table_name1 = $wpdb-&gt;prefix . "users";
  $table_name2 = $wpdb-&gt;prefix . "gf_entry_meta";
  $get_team_ids = $wpdb-&gt;get_results("SELECT * FROM $table_name2 where value = '" .$post_7-&gt;post_title. "'");
  
   if( is_mr() ) {
       //print_r($get_team_ids);
       //print_r( $getuserids );
   }
  
   $users = array();
   if(!empty($get_team_ids)){
   foreach ($get_team_ids as $idlead) {
          $user_email = $wpdb-&gt;get_var("SELECT value FROM wp_gf_entry_meta WHERE form_id=4 AND lead_id=$idlead-&gt;lead_id AND field_number=3");
          if( empty( $user_email ) ) {
          $user_email = $wpdb-&gt;get_var("SELECT value FROM wp_gf_entry_meta WHERE form_id=1 AND lead_id=$idlead-&gt;lead_id AND field_number=2");
          }
          if( $user_email ) $users[] = $user_email;
  
        //$concate .= $idlead-&gt;lead_id.',';
   }
   $concate = substr($concate, 0,-1);
   //echo $concate;
  </code></pre>
  
  <p>}</p>