Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 16577 программистов и 1767 роботов. Сейчас ищут 1643 программиста ...
->query()
Вернуться к: DB_DataObject
->query()
->query() – send a raw query
Synopsis
void $DB_DataObject->query ( string $string )
Sends a raw query to database. Often you may consider that using a large number of whereAdd's and orderBy method calls are not necessary, and it would be simpler to just write the query, to make the code clearer and shorter.
Parameter
-
string $string - SQL Query
Note
This function can not be called statically.
Example
raw queries on the database
<?php
$person = new DataObjects_Person;
$person->query("SELECT * FROM {$person->__table} WHERE id > 12 ORDER BY id");
while ($person->fetch()) {
echo $person->name;
}
?>
Вернуться к: DB_DataObject