Answers.Body: <p>Check if <code>www-data</code> has write permissions in <code>/var/mysqltmp</code> directory.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-12T18:01:47.840Z
Answers.Text: I don't have access to this folder as I am working on shared hosting.
Answers.UserDisplayName: Mohit Thareja
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-12T08:06:02.757Z
Answers.LastActivityDate: 2017-12-12T08:06:02.757Z
Answers.UserDisplayName: Djordje Marjanovic
Body: <p>I am using Hostgator shared hosting for CIVI CRM and Drupal.From few days, I am getting an error that Error writing file '/var/mysqltmp/MYCckA2E' (Errcode: 28)".</p>
  
  <p>I tried to change the queries and removed the order by clause.The query is working in phpmyadmin but there is an error in civi website.  </p>
  
  <p><strong>Please help me with this issue.your suggestions are most welcome.</strong></p>
  
  <p>function query($string)
      {</p>
  
  <p>if (strpos(trim($string), 'SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_sort_name, contact_civireport.id as civicrm_contact_id FROM civicrm_contact contact_civireport WHERE ( contact_civireport.is_deceased LIKE 0 ) ORDER BY contact_civireport.sort_name ASC LIMIT 0, 10') == false)
  {
  $string=str_replace("ORDER BY contact_civireport.sort_name ASC","","SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_sort_name, contact_civireport.id as civicrm_contact_id FROM civicrm_contact contact_civireport WHERE ( contact_civireport.is_deceased LIKE 0 ) ORDER BY contact_civireport.sort_name ASC LIMIT 0, 10");
  echo $string;
          return $this->_query($string);
          }
          else<br>
          return $this->_query($string);
      }</p>
  
Tags: <civicontribute><contacts><civireport>
Title: Getting Error in running contact Report
ThreadText: # Getting Error in running contact Report
  
  (Asked by: username_0 on 2017-12-12)
  
  I am using Hostgator shared hosting for CIVI CRM and Drupal.From few days, I am getting an error that Error writing file '/var/mysqltmp/MYCckA2E' (Errcode: 28)".
  
  I tried to change the queries and removed the order by clause.The query is working in phpmyadmin but there is an error in civi website.
  
  **Please help me with this issue.your suggestions are most welcome.**
  
  function query($string)
  {
  
  if (strpos(trim($string), 'SELECT SQL\_CALC\_FOUND\_ROWS contact\_civireport.sort\_name as civicrm\_contact\_sort\_name, contact\_civireport.id as civicrm\_contact\_id FROM civicrm\_contact contact\_civireport WHERE ( contact\_civireport.is\_deceased LIKE 0 ) ORDER BY contact\_civireport.sort\_name ASC LIMIT 0, 10') == false)
  {
  $string=str\_replace("ORDER BY contact\_civireport.sort\_name ASC","","SELECT SQL\_CALC\_FOUND\_ROWS contact\_civireport.sort\_name as civicrm\_contact\_sort\_name, contact\_civireport.id as civicrm\_contact\_id FROM civicrm\_contact contact\_civireport WHERE ( contact\_civireport.is\_deceased LIKE 0 ) ORDER BY contact\_civireport.sort\_name ASC LIMIT 0, 10");
  echo $string;
  return $this->\_query($string);
  }
  else  
  return $this->\_query($string);
  }
  
  **Tags:** civicontribute, contacts, civireport
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-12-12. Score: 1
  
  Check if `www-data` has write permissions in `/var/mysqltmp` directory.
  
  > **Comments:**
  > **username_0**: I don't have access to this folder as I am working on shared hosting.  
  
  ---
  
  