DB::$param_char can now be used to change the char that needs to appear in front of params (% is the default)

This commit is contained in:
Sergey Tsalkov
2011-04-28 18:41:13 -04:00
parent ad4889da09
commit 96892fa6c2
2 changed files with 28 additions and 27 deletions

View File

@@ -86,9 +86,11 @@ class BasicTest extends SimpleTest {
$counter = DB::queryFirstField("SELECT COUNT(*) FROM accounts");
$this->assert($counter === strval(3));
$bart = DB::queryFirstRow("SELECT * FROM accounts WHERE age IN %li AND height IN %ld AND username IN %ls",
DB::$param_char = '###';
$bart = DB::queryFirstRow("SELECT * FROM accounts WHERE age IN ###li AND height IN ###ld AND username IN ###ls",
array(15, 25), array(10.371, 150.123), array('Bart', 'Barts'));
$this->assert($bart['username'] === 'Bart');
DB::$param_char = '%';
$charlie_password = DB::queryFirstField("SELECT password FROM accounts WHERE username IN %ls AND username = %s",
array('Charlie', 'Charlie\'s Friend'), 'Charlie\'s Friend');