can now refer to a specific argument in a query

e.g. %s2 for the third argument, taken as a string
This commit is contained in:
Sergey Tsalkov
2011-12-17 19:54:55 -08:00
parent a1f01a4f87
commit 7825f90080
2 changed files with 17 additions and 3 deletions

View File

@@ -165,6 +165,9 @@ class BasicTest extends SimpleTest {
$ct = DB::queryFirstField("SELECT COUNT(*) FROM accounts WHERE username=%s AND height=%d", 'gonesoon', 199.194);
$this->assert(intval($ct) === 1);
$ct = DB::queryFirstField("SELECT COUNT(*) FROM accounts WHERE username=%s1 AND height=%d0 AND height=%d", 199.194, 'gonesoon');
$this->assert(intval($ct) === 1);
DB::delete('accounts', 'username=%s AND age=%i AND height=%d', 'gonesoon', '61', '199.194');
$this->assert(DB::affectedRows() === 1);