Changeset 10299 for temp/trunk/data/lib


Ignore:
Timestamp:
2006/12/06 12:30:51 (20 years ago)
Author:
kaki
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/data/lib/slib.php

    r10247 r10299  
    25242524} 
    25252525 
    2526  
     2526// SQL¥·¥ó¥°¥ë¥¯¥©¡¼¥ÈÂбþ 
    25272527function sfQuoteSmart($in){ 
    25282528     
     
    25662566    $changesql = eregi_replace("( RANDOM)", " RAND", $sql); 
    25672567    return $changesql; 
     2568} 
     2569 
     2570// view¤Îwhere¤òÃÖ´¹¤¹¤ë 
     2571function sfViewWhere($target, $where = "", $arrval = array(), $option = ""){ 
     2572    global $arrViewWhere; 
     2573    $arrWhere = split("[?]", $where); 
     2574    $where_tmp = " WHERE " . $arrWhere[0]; 
     2575    for($i = 1; $i < count($arrWhere); $i++){ 
     2576        $where_tmp .= sfQuoteSmart($arrval[$i - 1]) . $arrWhere[$i]; 
     2577    } 
     2578    $arrViewWhere[$target] = $where_tmp . " " . $option; 
    25682579} 
    25692580 
Note: See TracChangeset for help on using the changeset viewer.