Lines Matching refs:stmt

18 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
19 $stmt->bind_param('sss', ...[&$abc, 42, $id]);
20 $stmt->execute();
21 assert($stmt->get_result()->fetch_assoc() === ['label'=>'a', 'anon'=>'abc', 'num' => '42']);
22 $stmt = null;
25 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
26 $stmt->execute([&$abc, 42, $id]);
27 assert($stmt->get_result()->fetch_assoc() === ['label'=>'a', 'anon'=>'abc', 'num' => '42']);
28 $stmt = null;
31 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
33 $stmt->execute([&$abc, 42]);
37 $stmt = null;
40 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
42 $stmt->execute([&$abc, null, $id, 24]);
46 $stmt = null;
49 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
51 $stmt->execute([]);
55 $stmt = null;
58 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
60 $stmt->execute();
64 $stmt = null;
67 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
69 $stmt->execute(42);
73 $stmt = null;
76 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
78 $stmt->execute((object)[&$abc, 42, $id]);
82 $stmt = null;
85 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
88 $stmt->execute($arr2);
89 assert($stmt->get_result()->fetch_assoc() === ['label'=>'a', 'anon'=>'abc', 'num' => '42']);
90 $stmt = null;
93 $stmt = $link->prepare('SELECT label FROM test WHERE id=1');
94 $stmt->execute([]);
95 assert($stmt->get_result()->fetch_assoc() === ['label'=>'a']);
96 $stmt = null;
99 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
100 $stmt->execute(['abc', 42, $id]);
101 assert($stmt->get_result()->fetch_assoc() === ['label'=>'a', 'anon'=>'abc', 'num' => '42']);
102 $stmt->execute(); // no argument here. Values are already bound
103 assert($stmt->get_result()->fetch_assoc() === ['label'=>'a', 'anon'=>'abc', 'num' => '42']);
105 $stmt->execute([]); // no params here. PDO doesn't throw an error, but mysqli does
109 $stmt = null;
112 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
113 $stmt->bind_param('sss', ...['abc', 42, null]);
114 $stmt->execute([null, null, $id]);
115 assert($stmt->get_result()->fetch_assoc() === ['label'=>'a', 'anon'=>null, 'num' => null]);
116 $stmt = null;
119 $stmt = $link->prepare('SELECT label, ? AS anon, ? AS num FROM test WHERE id=?');
121 $stmt->execute(['A'=>'abc', 2=>42, null=>$id]);
125 $stmt = null;