/[drupal]/contributions/modules/regcode/regcode.api.php
ViewVC logotype

Diff of /contributions/modules/regcode/regcode.api.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.9, Wed Sep 30 18:17:26 2009 UTC revision 1.1.2.10, Wed Oct 14 14:48:11 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: regcode.api.php,v 1.1.2.8 2009/09/27 09:16:25 aidan Exp $  // $Id: regcode.api.php,v 1.1.2.9 2009/09/30 18:17:26 aidan Exp $
3    
4  define('REGCODE_VALIDITY_NOTEXISTING',    0);  define('REGCODE_VALIDITY_NOTEXISTING',    0);
5  define('REGCODE_VALIDITY_NOTAVAILABLE',  -1);  define('REGCODE_VALIDITY_NOTAVAILABLE',  -1);
# Line 122  function regcode_save_code($code, $actio Line 122  function regcode_save_code($code, $actio
122    }    }
123    
124    if ($action == 'overwrite') {    if ($action == 'overwrite') {
125      db_query('DELETE FROM {regcode} WHERE code = "%s" LIMIT 1', $code['code']);      db_query("DELETE FROM {regcode} WHERE code = '%s' LIMIT 1", $code['code']);
126    }    }
127    
128    // Format data    // Format data
# Line 148  function regcode_save_code($code, $actio Line 148  function regcode_save_code($code, $actio
148   * Count codes   * Count codes
149   */   */
150  function regcode_count($where = '') {  function regcode_count($where = '') {
151    return db_result(db_query('SELECT COUNT(rid) FROM {regcode}' . $where));    return db_result(db_query('SELECT COUNT(rid) AS count FROM {regcode}' . $where));
152  }  }
153    
154    

Legend:
Removed from v.1.1.2.9  
changed lines
  Added in v.1.1.2.10

  ViewVC Help
Powered by ViewVC 1.1.2