Lines Matching refs:stmt

16     $stmt = mysqli_stmt_init($link);
18 if (!mysqli_stmt_prepare($stmt, 'DROP TABLE IF EXISTS test') ||
19 !mysqli_stmt_execute($stmt)) {
20 …03] Failed to drop old test table: [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
23 …if (!mysqli_stmt_prepare($stmt, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE …
24 !mysqli_stmt_execute($stmt)) {
25 …[004] Failed to create test table: [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
28 if (0 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
31 mysqli_stmt_close($stmt);
32 $stmt = mysqli_stmt_init($link);
34 if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (1, 'a')") ||
35 !mysqli_stmt_execute($stmt))
36 printf("[006] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
38 mysqli_stmt_close($stmt);
39 $stmt = mysqli_stmt_init($link);
41 if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (100, 'z')") ||
42 !mysqli_stmt_execute($stmt))
43 printf("[007] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
45 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
48 mysqli_stmt_close($stmt);
49 $stmt = mysqli_stmt_init($link);
51 if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (100, 'z')") ||
52 !mysqli_stmt_execute($stmt))
54 … message varies with the MySQL Server version, check the error code)\n", mysqli_stmt_errno($stmt));
57 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
60 mysqli_stmt_close($stmt);
61 $stmt = mysqli_stmt_init($link);
63 …if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (1, 'a') ON DUPLICATE KEY UPDA…
64 !mysqli_stmt_execute($stmt))
65 printf("[011] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
67 if (2 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
70 mysqli_stmt_close($stmt);
71 $stmt = mysqli_stmt_init($link);
73 if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (2, 'b'), (3, 'c')") ||
74 !mysqli_stmt_execute($stmt))
75 printf("[013] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
77 if (2 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
80 mysqli_stmt_close($stmt);
81 $stmt = mysqli_stmt_init($link);
83 if (!mysqli_stmt_prepare($stmt, "INSERT IGNORE INTO test(id, label) VALUES (1, 'a')") ||
84 !mysqli_stmt_execute($stmt))
85 printf("[015] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
87 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
96 mysqli_stmt_close($stmt);
97 $stmt = mysqli_stmt_init($link);
99 … if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) SELECT id + 10, label FROM test") ||
100 !mysqli_stmt_execute($stmt))
101 printf("[018] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
103 if ($num !== ($tmp = mysqli_stmt_affected_rows($stmt)))
106 mysqli_stmt_close($stmt);
107 $stmt = mysqli_stmt_init($link);
109 if (!mysqli_stmt_prepare($stmt, "REPLACE INTO test(id, label) values (4, 'd')") ||
110 !mysqli_stmt_execute($stmt))
111 printf("[020] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
113 if (2 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
116 mysqli_stmt_close($stmt);
117 $stmt = mysqli_stmt_init($link);
119 if (!mysqli_stmt_prepare($stmt, "REPLACE INTO test(id, label) values (5, 'e')") ||
120 !mysqli_stmt_execute($stmt))
121 printf("[022] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
123 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
126 mysqli_stmt_close($stmt);
127 $stmt = mysqli_stmt_init($link);
129 if (!mysqli_stmt_prepare($stmt, "UPDATE test SET label = 'a' WHERE id = 2") ||
130 !mysqli_stmt_execute($stmt))
131 printf("[024] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
133 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
136 if (!mysqli_stmt_prepare($stmt, "UPDATE test SET label = 'a' WHERE id = 2") ||
137 !mysqli_stmt_execute($stmt))
138 printf("[026] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
140 if (0 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
143 mysqli_stmt_close($stmt);
144 $stmt = mysqli_stmt_init($link);
146 if (!mysqli_stmt_prepare($stmt, "UPDATE test SET label = 'a' WHERE id = 100") ||
147 !mysqli_stmt_execute($stmt))
148 printf("[028] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
150 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
153 if (!mysqli_stmt_prepare($stmt, 'SELECT label FROM test WHERE id = 100') ||
154 !mysqli_stmt_execute($stmt))
155 printf("[030] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
159 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
162 if (0 !== ($tmp = mysqli_stmt_num_rows($stmt)))
165 if (!mysqli_stmt_store_result($stmt))
166 printf("[033] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
168 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
171 if (1 !== ($tmp = mysqli_stmt_num_rows($stmt)))
174 mysqli_stmt_free_result($stmt);
175 mysqli_stmt_close($stmt);
176 $stmt = mysqli_stmt_init($link);
178 if (!mysqli_stmt_prepare($stmt, 'SELECT label FROM test WHERE 1 = 2') ||
179 !mysqli_stmt_execute($stmt))
180 printf("[036] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
183 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
186 if (true !== ($tmp = mysqli_stmt_store_result($stmt)))
189 if (0 !== ($tmp = mysqli_stmt_num_rows($stmt)))
192 if (0 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
197 if (mysqli_stmt_prepare($stmt, 'SELECT unknown_column FROM this_table_does_not_exist') ||
198 mysqli_stmt_execute($stmt))
201 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
204 if (true !== ($tmp = mysqli_stmt_store_result($stmt)))
207 if (0 !== ($tmp = mysqli_stmt_num_rows($stmt)))
210 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
213 mysqli_stmt_close($stmt);
214 $stmt = mysqli_stmt_init($link);
216 if (!mysqli_stmt_prepare($stmt, "DROP TABLE IF EXISTS test") ||
217 !mysqli_stmt_execute($stmt))
218 printf("[046] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
220 mysqli_stmt_close($stmt);
223 mysqli_stmt_affected_rows($stmt);