Lines Matching refs:stmt

17     $stmt = mysqli_stmt_init($link);
19 if (!mysqli_stmt_prepare($stmt, 'DROP TABLE IF EXISTS test') ||
20 !mysqli_stmt_execute($stmt)) {
21 …03] Failed to drop old test table: [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
24 …if (!mysqli_stmt_prepare($stmt, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE …
25 !mysqli_stmt_execute($stmt)) {
26 …[004] Failed to create test table: [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
29 if (0 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
32 mysqli_stmt_close($stmt);
33 $stmt = mysqli_stmt_init($link);
35 if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (1, 'a')") ||
36 !mysqli_stmt_execute($stmt))
37 printf("[006] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
39 mysqli_stmt_close($stmt);
40 $stmt = mysqli_stmt_init($link);
42 if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (100, 'z')") ||
43 !mysqli_stmt_execute($stmt))
44 printf("[007] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
46 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
49 mysqli_stmt_close($stmt);
50 $stmt = mysqli_stmt_init($link);
52 if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (100, 'z')") ||
53 !mysqli_stmt_execute($stmt))
55 … message varies with the MySQL Server version, check the error code)\n", mysqli_stmt_errno($stmt));
58 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
61 mysqli_stmt_close($stmt);
62 $stmt = mysqli_stmt_init($link);
64 …if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (1, 'a') ON DUPLICATE KEY UPDA…
65 !mysqli_stmt_execute($stmt))
66 printf("[011] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
68 if (2 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
71 mysqli_stmt_close($stmt);
72 $stmt = mysqli_stmt_init($link);
74 if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (2, 'b'), (3, 'c')") ||
75 !mysqli_stmt_execute($stmt))
76 printf("[013] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
78 if (2 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
81 mysqli_stmt_close($stmt);
82 $stmt = mysqli_stmt_init($link);
84 if (!mysqli_stmt_prepare($stmt, "INSERT IGNORE INTO test(id, label) VALUES (1, 'a')") ||
85 !mysqli_stmt_execute($stmt))
86 printf("[015] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
88 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
97 mysqli_stmt_close($stmt);
98 $stmt = mysqli_stmt_init($link);
100 … if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) SELECT id + 10, label FROM test") ||
101 !mysqli_stmt_execute($stmt))
102 printf("[018] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
104 if ($num !== ($tmp = mysqli_stmt_affected_rows($stmt)))
107 mysqli_stmt_close($stmt);
108 $stmt = mysqli_stmt_init($link);
110 if (!mysqli_stmt_prepare($stmt, "REPLACE INTO test(id, label) values (4, 'd')") ||
111 !mysqli_stmt_execute($stmt))
112 printf("[020] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
114 if (2 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
117 mysqli_stmt_close($stmt);
118 $stmt = mysqli_stmt_init($link);
120 if (!mysqli_stmt_prepare($stmt, "REPLACE INTO test(id, label) values (5, 'e')") ||
121 !mysqli_stmt_execute($stmt))
122 printf("[022] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
124 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
127 mysqli_stmt_close($stmt);
128 $stmt = mysqli_stmt_init($link);
130 if (!mysqli_stmt_prepare($stmt, "UPDATE test SET label = 'a' WHERE id = 2") ||
131 !mysqli_stmt_execute($stmt))
132 printf("[024] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
134 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
137 if (!mysqli_stmt_prepare($stmt, "UPDATE test SET label = 'a' WHERE id = 2") ||
138 !mysqli_stmt_execute($stmt))
139 printf("[026] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
141 if (0 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
144 mysqli_stmt_close($stmt);
145 $stmt = mysqli_stmt_init($link);
147 if (!mysqli_stmt_prepare($stmt, "UPDATE test SET label = 'a' WHERE id = 100") ||
148 !mysqli_stmt_execute($stmt))
149 printf("[028] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
151 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
154 if (!mysqli_stmt_prepare($stmt, 'SELECT label FROM test WHERE id = 100') ||
155 !mysqli_stmt_execute($stmt))
156 printf("[030] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
160 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
163 if (0 !== ($tmp = mysqli_stmt_num_rows($stmt)))
166 if (!mysqli_stmt_store_result($stmt))
167 printf("[033] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
169 if (1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
172 if (1 !== ($tmp = mysqli_stmt_num_rows($stmt)))
175 mysqli_stmt_free_result($stmt);
176 mysqli_stmt_close($stmt);
177 $stmt = mysqli_stmt_init($link);
179 if (!mysqli_stmt_prepare($stmt, 'SELECT label FROM test WHERE 1 = 2') ||
180 !mysqli_stmt_execute($stmt))
181 printf("[036] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
184 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
187 if (true !== ($tmp = mysqli_stmt_store_result($stmt)))
190 if (0 !== ($tmp = mysqli_stmt_num_rows($stmt)))
193 if (0 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
198 if (mysqli_stmt_prepare($stmt, 'SELECT unknown_column FROM this_table_does_not_exist') ||
199 mysqli_stmt_execute($stmt))
202 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
205 if (true !== ($tmp = mysqli_stmt_store_result($stmt)))
208 if (0 !== ($tmp = mysqli_stmt_num_rows($stmt)))
211 if (-1 !== ($tmp = mysqli_stmt_affected_rows($stmt)))
214 mysqli_stmt_close($stmt);
215 $stmt = mysqli_stmt_init($link);
217 if (!mysqli_stmt_prepare($stmt, "DROP TABLE IF EXISTS test") ||
218 !mysqli_stmt_execute($stmt))
219 printf("[046] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
221 mysqli_stmt_close($stmt);
224 mysqli_stmt_affected_rows($stmt);