title: why sql give me error "Invalid parameter number: parameter was not defined"
body: <p>Today I got error Invalid parameter number: parameter was not defined in my yii app while updating data . then i come to know that my sql database table column contains name with "-" symbol i.e "table-post" etc . </p>
  
  <p>Then i changed "-" with "_" and everything is working . </p>
  
  <p>This is the query snippet (I replaced the "-" with "_")</p>
  
  <pre><code>/* percentage  losses  senser*/
      $attributes['totlcommloss_sensor']  = $_POST['totlcommloss_sensor'];
      $attributes['asp_hour_sensor']= $_POST['asp-hour_sensor'];
      $attributes['asp_daily_sensor'] = $_POST['asp-daily_sensor'];
      $attributes['asp_weekly_sensor']= $_POST['asp-weekly_sensor'];
      $attributes['asp_monthly_sensor'] = $_POST['asp-monthly_sensor'];
      $attributes['asp_5_day_senser']= $_POST['asp_5_day_senser'];
  
      /* cost losses */
      //$attributes['costlosshourly'] = $_POST['acs-hourly'];
  
      if (0 != intval($user['id'])) {         
          $command-&gt;update('alarm_settings', $attributes, 'id=:id', array(':id' =&gt; intval($user['id'])));
              } 
      else {
          $NumberOfRowsEffected = $command-&gt;insert('alarm_settings', $attributes);
           }
  </code></pre>
  
  <p>Can some one explain why this example shows error? Many thanks in advance.</p>