예제 #1
0
/**
 * @param string $str
 * @param bool $used_in_like
 * @return mixed|string
 */
function sql_prepare($str, $used_in_like = false)
{
    return SQL::sql_prepare($str, $used_in_like);
}
예제 #2
0
 /**
  * @return string
  */
 private function getWhereSql()
 {
     $res = [];
     foreach ($this->getWhereFields() as $field_data) {
         if ($field_data['type'] == 'simple') {
             $res[] = '`' . $field_data['table'] . '`.`' . $field_data['field'] . '` = "' . SQL::sql_prepare($field_data['value']) . '"';
         } elseif ($field_data['type'] == 'string') {
             $res[] = $field_data['value'];
         }
     }
     return implode(' AND ', $res);
 }