Changeset 10650 for temp


Ignore:
Timestamp:
2006/12/14 18:44:11 (20 years ago)
Author:
uehara
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/branches/ec-cube-beta/data/lib/slib.php

    r10399 r10650  
    117117     
    118118    return false; 
     119} 
     120 
     121// ¥Ç¡¼¥¿¤Î¸ºß¥Á¥§¥Ã¥¯ 
     122function sfDataExists($table_name, $where, $arrval, $dsn = "", $sql = "", $add = false) { 
     123    if($dsn == "") { 
     124        if(defined('DEFAULT_DSN')) { 
     125            $dsn = DEFAULT_DSN; 
     126        } else { 
     127            return; 
     128        } 
     129    } 
     130    $objQuery = new SC_Query($dsn, true, true); 
     131    $count = $objQuery->count($table_name, $where, $arrval); 
     132 
     133    if($count > 0) { 
     134        $ret = true; 
     135    } else { 
     136        $ret = false; 
     137    } 
     138    // ¥Ç¡¼¥¿¤òÄɲ乤ë 
     139    if(!$ret && $add) { 
     140        $objQuery->exec($sql); 
     141    } 
     142     
     143    return $ret; 
    119144} 
    120145 
Note: See TracChangeset for help on using the changeset viewer.