Lines Matching refs:stmt
26 $stmt = mysqli_stmt_init($link);
28 if (!mysqli_stmt_prepare($stmt, 'DROP TABLE IF EXISTS test') ||
29 !mysqli_stmt_execute($stmt)) {
30 …03] Failed to drop old test table: [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
33 …if (!mysqli_stmt_prepare($stmt, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE …
34 !mysqli_stmt_execute($stmt)) {
35 …[004] Failed to create test table: [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
38 if (0 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
41 mysqli_stmt_close($stmt);
42 $stmt = mysqli_stmt_init($link);
44 if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (1, 'a')") ||
45 !mysqli_stmt_execute($stmt))
46 printf("[006] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($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))
53 printf("[007] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
55 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
58 mysqli_stmt_close($stmt);
59 $stmt = mysqli_stmt_init($link);
61 if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (100, 'z')") ||
62 !mysqli_stmt_execute($stmt))
64 … message varies with the MySQL Server version, check the error code)\n", mysqli_stmt_errno($stmt));
67 if (-1 !== ($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 (1, 'a') ON DUPLICATE KEY UPDA…
74 !mysqli_stmt_execute($stmt))
75 printf("[011] [%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 INTO test(id, label) VALUES (2, 'b'), (3, 'c')") ||
84 !mysqli_stmt_execute($stmt))
85 printf("[013] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
87 if (2 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
90 mysqli_stmt_close($stmt);
91 $stmt = mysqli_stmt_init($link);
93 if (!mysqli_stmt_prepare($stmt, "INSERT IGNORE INTO test(id, label) VALUES (1, 'a')") ||
94 !mysqli_stmt_execute($stmt))
95 printf("[015] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
97 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
106 mysqli_stmt_close($stmt);
107 $stmt = mysqli_stmt_init($link);
109 if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) SELECT id + 10, label FROM test") ||
110 !mysqli_stmt_execute($stmt))
111 printf("[018] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
113 if ($num !== ($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 (4, 'd')") ||
120 !mysqli_stmt_execute($stmt))
121 printf("[020] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
123 if (2 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
126 mysqli_stmt_close($stmt);
127 $stmt = mysqli_stmt_init($link);
129 if (!mysqli_stmt_prepare($stmt, "REPLACE INTO test(id, label) values (5, 'e')") ||
130 !mysqli_stmt_execute($stmt))
131 printf("[022] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
133 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
136 mysqli_stmt_close($stmt);
137 $stmt = mysqli_stmt_init($link);
139 if (!mysqli_stmt_prepare($stmt, "UPDATE test SET label = 'a' WHERE id = 2") ||
140 !mysqli_stmt_execute($stmt))
141 printf("[024] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
143 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
146 if (!mysqli_stmt_prepare($stmt, "UPDATE test SET label = 'a' WHERE id = 2") ||
147 !mysqli_stmt_execute($stmt))
148 printf("[026] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
150 if (0 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
153 mysqli_stmt_close($stmt);
154 $stmt = mysqli_stmt_init($link);
156 if (!mysqli_stmt_prepare($stmt, "UPDATE test SET label = 'a' WHERE id = 100") ||
157 !mysqli_stmt_execute($stmt))
158 printf("[028] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
160 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
163 if (!mysqli_stmt_prepare($stmt, 'SELECT label FROM test WHERE id = 100') ||
164 !mysqli_stmt_execute($stmt))
165 printf("[030] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
169 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
172 if (0 !== ($tmp = mysqli_stmt_num_rows($stmt)))
175 if (!mysqli_stmt_store_result($stmt))
176 printf("[033] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
178 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
181 if (1 !== ($tmp = mysqli_stmt_num_rows($stmt)))
184 mysqli_stmt_free_result($stmt);
185 mysqli_stmt_close($stmt);
186 $stmt = mysqli_stmt_init($link);
188 if (!mysqli_stmt_prepare($stmt, 'SELECT label FROM test WHERE 1 = 2') ||
189 !mysqli_stmt_execute($stmt))
190 printf("[036] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
193 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
196 if (true !== ($tmp = mysqli_stmt_store_result($stmt)))
199 if (0 !== ($tmp = mysqli_stmt_num_rows($stmt)))
202 if (0 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
207 if (mysqli_stmt_prepare($stmt, 'SELECT unknown_column FROM this_table_does_not_exist') ||
208 mysqli_stmt_execute($stmt))
211 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
215 if (false !== ($tmp = mysqli_stmt_store_result($stmt)))
218 if (true !== ($tmp = mysqli_stmt_store_result($stmt)))
222 if (0 !== ($tmp = mysqli_stmt_num_rows($stmt)))
225 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
228 mysqli_stmt_close($stmt);
229 $stmt = mysqli_stmt_init($link);
231 if (!mysqli_stmt_prepare($stmt, "DROP TABLE IF EXISTS test") ||
232 !mysqli_stmt_execute($stmt))
233 printf("[046] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
235 mysqli_stmt_close($stmt);
237 if (!is_null($tmp = mysqli_stmt_affected_rows($stmt)))