Benutzer-Werkzeuge

Webseiten-Werkzeuge


select

**Dies ist eine alte Version des Dokuments!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== DB: Abfragen ====== <code php> // return a single customer whose ID is 123 // SELECT * FROM `customer` WHERE `id` = 123 $customer = Customer::find() ->where(['id' => 123]) ->one(); // return all active customers and order them by their IDs // SELECT * FROM `customer` WHERE `status` = 1 ORDER BY `id` $customers = Customer::find() ->where(['status' => Customer::STATUS_ACTIVE]) ->orderBy('id') ->all(); // return the number of active customers // SELECT COUNT(*) FROM `customer` WHERE `status` = 1 $count = Customer::find() ->where(['status' => Customer::STATUS_ACTIVE]) ->count(); // return all active customers in an array indexed by customer IDs // SELECT * FROM `customer` $customers = Customer::find() ->indexBy('id') ->all(); </code>

select.1432133190.txt.gz · Zuletzt geändert: 2015/05/20 16:46 von 213.200.218.142