title: Large Forms = Large PHP/mySql Query Strings... Is There a Good Solution?
body: <p>I've got a CMS I'm building where I've got a rather large form full of data to add to my database.  This is where I collect my variables....</p>
  
  <p><code></p>
  
  <pre><code>$orgName = $_POST['orgName'];
  $impact = $_POST['impact'];
  $headline = $_POST['headline'];
  $content = $_POST['content'];
  $subContent = $_POST['subContent'];
  $meterText = $_POST['meterText'];
  $month = $_POST['month'];
  $shopLink = $_POST['shopLink'];
  $blurbTitle = $_POST['blurbTitle'];
  $blurb = $_POST['blurb'];
  $logoURL = $_POST['logoURL'];
  $buttonURL = $_POST['buttonURL'];
  $blurbURL = $_POST['blurbURL'];
  $POMURL = $_POST['POMURL'];
  $horizontalURL = $_POST['horizontalURL'];
  $statURL = $_POST['statURL'];
  $stats = $_POST['stats'];
  </code></pre>
  
  <p>here I sql escape, validate and send to my function (omitted validation for space)...</p>
  
  <pre><code>require_once 'DB_Connect.php';
  
  $connection = new DB_Connect();    
  
  $connection-&gt;insertPartner(
      $index,
      mysql_real_escape_string($orgName),
      mysql_real_escape_string($impact),
      mysql_real_escape_string($headline),
      mysql_real_escape_string($content),
      mysql_real_escape_string($subContent),
      $month,
      mysql_real_escape_string($shopLink),
      mysql_real_escape_string($blurbTitle),
      mysql_real_escape_string($meterText),
      mysql_real_escape_string($blurb),
      mysql_real_escape_string($stats),
      mysql_real_escape_string($logoURL),
      mysql_real_escape_string($buttonURL),
      mysql_real_escape_string($blurbURL),
      mysql_real_escape_string($POMURL),
      mysql_real_escape_string($horizontalURL),
      mysql_real_escape_string($statURL)
      ))
  </code></pre>
  
  <p></code></p>
  
  <p>and finally the function...</p>
  
  <pre><code>public function insertPartner(
      $orgName = '',
      $impact = '',
      $headline = '',
      $content = '',
      $subContent = '',
      $month = '',
      $shopLink = '',
      $blurbTitle = '',
      $blurb = '',
      $stats = '',
      $logoURL = '',
      $buttonURL = '',
      $blurbURL = '',
      $POMURL = '',
      $horizontalURL = '',
      $statURL = '')
      {
          $query="INSERT INTO `hupcap_FCE`.`fce_partners` (
          `index`,
          `organization_name`,
          `impact`,
          `headline`,
          `content`,
          `sub_content`,
          `blurb_title`,
          `blurb`,
          `stats`,
          `month`,
          `meter_number`,
          `meter_text`,
          `shop_link`,
          `button_img_url`,
          `blurb_img_url`,
          `logo_url`,
          `month_img_url`,
          `horizontal_logo_url`,
          `stat_img_url`,
          `util`
          ) VALUES (
          '',
          '$orgName',
          '$impact',
          '$headline',
          '$content',
          '$subContent',
          '$blurbTitle',
          '$blurb',
          '$stats',
          '$month',
          0,
          '',
          '$shopLink',
          '$buttonURL',
          '$blurbURL',
          '$logoURL',
          '$POMURL',
          '$horizontalURL',
          '$statURL',
          0)";
          if(mysql_query($query)){
              return true;
          }else{
              die("failed to insert record" . mysql_error());
          }
      }
  </code></pre>
  
  <p>There has GOT to be a slicker way of doing this.
  Who's got the best method?</p>
  
  <p>Thanks -J</p>