title: Quickbase delete_record
body: <p>I am unable to get delete_record function to work. Here is the delete_record code that I am currently using:</p>
  
  <pre><code>$qb-&gt;db_id = $myQbTables["table1"]; //using table 1 now
  
  $queries = array( //this is the where clause now for the delete query
    array(
      'fid'  =&gt; '12',
      'ev'   =&gt; 'EX',
      'cri'  =&gt; '1175'
    ),
    array(
      'fid'  =&gt; '8',
      'ev'   =&gt; 'EX',
      'cri'  =&gt; $Child_ID
    )
  );
  
  $results = $qb-&gt;do_query($queries, '', '', 'a', '1', 'structured', 'sortorder-A'); //get all results
  if($results-&gt;errCode !== 0) {
    echo $results-&gt;errTxt;
  }
  
  print_r($results);
  
  foreach($results-&gt;table-&gt;records-&gt;record as $record){ //getting results of delete query
  $Deletevar = $record-&gt;f[11];    
  
  $deleted = $qb-&gt;delete_record($Deletevar); //deleting results
  
  print_r($deleted);  
  }
  </code></pre>
  
  <p>I know that the 'cri' matches things in my quickbase but I can't seem to use f[3] (the record id) to delete it!</p>
  
  <p><strong><em>NOTE</em></strong></p>
  
  <p>I have found the main issue I was having! If you are making API calls using the QB API, delete records and purge records does not include the app token!! Please use the following code to update the delete_records function!!!!</p>
  
  <pre><code>public function delete_record($rid) {
  if($this-&gt;xml) {
                          $xml_packet = new SimpleXMLElement('&lt;qdbapi&gt;&lt;/qdbapi&gt;');
                          $xml_packet-&gt;addChild('rid',$rid);
                          $xml_packet-&gt;addChild('ticket',$this-&gt;ticket);
                          $xml_packet-&gt;addChild('apptoken',$this-&gt;app_token);
                          $xml_packet = $xml_packet-&gt;asXML();                        
  
                          $response = $this-&gt;transmit($xml_packet, 'API_DeleteRecord');
                  }
                  else {
                        $url_string = $this-&gt;qb_ssl . $this-&gt;db_id. "?act=API_DeleteRecord&amp;ticket=". $this-&gt;ticket
                                          ."&amp;apptoken=".$this-&gt;app_token."&amp;rid=".$rid;
  
                          $response = $this-&gt;transmit($url_string);
                  }
  
  return $response;          
  }
  </code></pre>