Changeset 13305
- Timestamp:
- 2007/05/22 22:02:36 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dev/data/class/SC_Query.php
r13304 r13305 213 213 * 214 214 * @access public 215 * @param string$limit LIMIT¤Î·ï¿ô216 * @param integer$offset OFFSET¤Î·ï¿ô215 * @param mixed $limit LIMIT¤Î·ï¿ô 216 * @param mixed $offset OFFSET¤Î·ï¿ô 217 217 * @param string $return À¸À®¤·¤¿LIMIT,OFFSET¶ç¤òreturn¤¹¤ë¤«¤É¤¦¤« 218 218 * @return string À¸À®¤·¤¿LIMIT,OFFSET¶ç … … 231 231 } 232 232 } 233 234 function setgroupby($str) { 235 $this->groupby = "GROUP BY " . $str; 236 } 237 238 function andwhere($str) { 239 if($this->where != "") { 240 $this->where .= " AND " . $str; 241 } else { 242 $this->where = $str; 243 } 244 } 245 246 function orwhere($str) { 247 if($this->where != "") { 248 $this->where .= " OR " . $str; 249 } else { 250 $this->where = $str; 251 } 252 } 253 254 function setwhere($str) { 255 $this->where = $str; 256 } 257 258 function setorder($str) { 259 $this->order = "ORDER BY " . $str; 260 } 261 262 263 function setlimit($limit){ 264 if ( is_numeric($limit)){ 265 $this->option = " LIMIT " .$limit; 266 } 267 } 268 269 function setoffset($offset) { 270 if ( is_numeric($offset)){ 271 $this->offset = " OFFSET " .$offset; 272 } 273 } 274 275 233 234 /** 235 * GROUP BY ¶ç¤ò¥»¥Ã¥È¤¹¤ë 236 * 237 * @access public 238 * @param string $str ¥«¥é¥à̾ 239 */ 240 function setgroupby($str) { 241 $this->groupby = "GROUP BY " . $str; 242 } 243 244 /** 245 * WHERE ¶ç¤ò¥»¥Ã¥È¤¹¤ë(AND) 246 * 247 * @access public 248 * @param string $str WHERE ¶ç 249 * @example $objQuery->andWhere('product_id = ?'); 250 */ 251 function andwhere($str) { 252 if($this->where != "") { 253 $this->where .= " AND " . $str; 254 } else { 255 $this->where = $str; 256 } 257 } 258 259 /** 260 * WHERE ¶ç¤ò¥»¥Ã¥È¤¹¤ë(OR) 261 * 262 * @access public 263 * @param string $str WHERE ¶ç 264 * @example $objQuery->orWhere('product_id = ?'); 265 */ 266 function orwhere($str) { 267 if($this->where != "") { 268 $this->where .= " OR " . $str; 269 } else { 270 $this->where = $str; 271 } 272 } 273 274 /** 275 * WHERE ¶ç¤ò¥»¥Ã¥È¤¹¤ë 276 * 277 * @access public 278 * @param string $str WHERE ¶ç 279 * @example $objQuery->setWhere('product_id = ?'); 280 */ 281 function setwhere($str) { 282 $this->where = $str; 283 } 284 285 /** 286 * ORDER BY ¶ç¤ò¥»¥Ã¥È¤¹¤ë 287 * 288 * @access public 289 * @param string $str ¥«¥é¥à̾ 290 * @example $objQuery->setorder("rank DESC"); 291 */ 292 function setorder($str) { 293 $this->order = "ORDER BY " . $str; 294 } 295 296 /** 297 * LIMIT ¶ç¤ò¥»¥Ã¥È¤¹¤ë 298 * 299 * @access public 300 * @param mixed $limit LIMIT¤Î·ï¿ô 301 * @example $objQuery->setlimit(50); 302 */ 303 function setlimit($limit){ 304 if ( is_numeric($limit)){ 305 $this->option = " LIMIT " .$limit; 306 } 307 } 308 309 /** 310 * OFFSET ¶ç¤ò¥»¥Ã¥È¤¹¤ë 311 * 312 * @access public 313 * @param mixed $offset OFFSET¤Î·ï¿ô 314 * @example $objQuery->setOffset(30); 315 */ 316 function setoffset($offset) { 317 if ( is_numeric($offset)){ 318 $this->offset = " OFFSET " .$offset; 319 } 320 } 321 322 276 323 // INSERTʸ¤ÎÀ¸À®¡¦¼Â¹Ô 277 324 // $table :¥Æ¡¼¥Ö¥ë̾
Note: See TracChangeset
for help on using the changeset viewer.