title: How to insert contact form 7 data into mysql database in wordpress
body: <p>Please go through the below code, i am trying to insert my contact form 7 data into my mysql table(i.e. wp_tps_forms).
  In this case i copy paste below code in my functions.php file of theme, but it's didn't work.</p>
  
  <pre><code>add_action('wpcf7_before_send_mail', 'save_form');
  function save_form($wpcf7)
  {
      global $wpdb;
      $title = $wpcf7-&gt;title();
  
      $company_name=$wpcf7-&gt;posted_data["company-name"];
      $email=$wpcf7-&gt;posted_data["your-email"];
      $start_year=$wpcf7-&gt;posted_data["start-year"];
      $team=$wpcf7-&gt;posted_data["team"];
      $business_model=$wpcf7-&gt;posted_data["business-model"];
      $sub_category_business=$wpcf7-&gt;posted_data["sub-category-business"];
      $competition=$wpcf7-&gt;posted_data["competition"];
      $phase_of_business=$wpcf7-&gt;posted_data["phase-of-business"];
      $stage_of_product=$wpcf7-&gt;posted_data["stage-of-product"];
      $customer_traction=$wpcf7-&gt;posted_data["customer-traction"];
      $estimate_funding=$wpcf7-&gt;posted_data["estimate-funding"];
      $website_url=$wpcf7-&gt;posted_data["website-url"];
      $contact_number=$wpcf7-&gt;posted_data["contact-number"];
      $what_does_your_company_do=$wpcf7-&gt;posted_data["what-does-your-company-do"];
      $core_team=$wpcf7-&gt;posted_data["core-team"];
      $what_is_unique_selling_point=$wpcf7-&gt;posted_data["what-is-unique-selling-point"];
      $go_to_market=$wpcf7-&gt;posted_data["go-to-market"];
      $any_other_information=$wpcf7-&gt;posted_data["any-other-information"];
      $link_to_url=$wpcf7-&gt;posted_data["link-to-url"];
      $file=$wpcf7-&gt;posted_data["file-01"];
  
      $wpdb-&gt;insert( $wpdb-&gt;prefix . 'tps_forms', 
              array('id' =&gt; '','form'  =&gt; $submited['title'],'company-name'=&gt; '$company_name','your-email' =&gt; '$email','start-year' =&gt; '$start_year','team' =&gt; '$team','business-model' =&gt; '$business_model','sub-category-business' =&gt; '$sub_category_business','competition' =&gt; '$competition','phase-of-business' =&gt; '$phase_of_business','stage-of-product' =&gt; '$stage_of_product','customer-traction' =&gt; '$customer_traction','estimate-funding' =&gt; '$estimate_funding','website-url' =&gt; '$website_url','contact-number' =&gt; '$contact_number','what-does-your-company-do' =&gt; '$what_does_your_company_do','core-team' =&gt; '$core_team','what-is-unique-selling-point' =&gt; '$what_is_unique_selling_point','go-to-market' =&gt; '$go_to_market','any-other-information' =&gt; '$any_other_information','link-to-url' =&gt; '$link_to_url','file-01' =&gt; '$file','date' =&gt; date('Y-m-d H:i:s')));
  }
  </code></pre>
  
  <p>Please suggest me the proper way to do this.</p>