Lines Matching refs:link

15 	function create_table($link, $column, $min, $max, $engine, $offset) {
17 if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) {
20 mysqli_errno($link), mysqli_error($link));
26 if (!mysqli_query($link, $sql)) {
29 mysqli_errno($link), mysqli_error($link));
39 if (!mysqli_query($link, $sql)) {
42 mysqli_errno($link), mysqli_error($link));
50 function test_format($link, $format, $from, $order_by, $expected, $offset) {
52 if (!$stmt = mysqli_stmt_init($link)) {
55 mysqli_errno($link), mysqli_error($link));
141 if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
147 test_format($link, 'FORMAT(1.01, 0)', 'DUAL', null, '1', 10);
148 test_format($link, 'FORMAT(1.23, 1)', 'DUAL', null, '1.2', 20);
149 test_format($link, 'FORMAT(1.23, 2)', 'DUAL', null, '1.23', 30);
150 test_format($link, 'FORMAT(1234.567, 3)', 'DUAL', null, '1,234.567', 40);
152 test_format($link, 'FORMAT(1234.567, 4)', 'DUAL', null, '1,234.5670', 50);
154 mysqli_close($link);
158 test_format($link, 'FORMAT(id, 0)', 'test', null, '1', 60);
159 test_format($link, 'FORMAT(id + 0.1, 1)', 'test', null, '1.1', 70);
160 test_format($link, 'FORMAT(id + 0.01, 2)', 'test', null, '1.01', 80);
163 $expected = create_table($link, 'FLOAT', -10000, 10000, $engine, 90);
166 test_format($link, 'id AS order_by_col, FORMAT(col1, 0)', 'test', 'id', $expected, 100);
168 $expected = create_table($link, 'FLOAT UNSIGNED', 0, 10000, $engine, 110);
171 test_format($link, 'id AS order_by_col, FORMAT(col1, 0)', 'test', 'id', $expected, 120);
173 $expected = create_table($link, 'TINYINT', -128, 127, $engine, 130);
176 test_format($link, 'id AS order_by_col, FORMAT(col1, 0)', 'test', 'id', $expected, 140);
178 $expected = create_table($link, 'SMALLINT UNSIGNED', 0, 65535, $engine, 150);
181 test_format($link, 'id AS order_by_col, FORMAT(col1, 0)', 'test', 'id', $expected, 160);
183 $expected = create_table($link, 'MEDIUMINT', 0, 8388607, $engine, 170);
186 test_format($link, 'id AS order_by_col, FORMAT(col1, 0)', 'test', 'id', $expected, 180);
188 $expected = create_table($link, 'INT UNSIGNED', 0, 1000, $engine, 190);
191 test_format($link, 'id AS order_by_col, FORMAT(col1, 0)', 'test', 'id', $expected, 200);
193 $expected = create_table($link, 'BIGINT', -1000, 1000, $engine, 210);
196 test_format($link, 'id AS order_by_col, FORMAT(col1, 0)', 'test', 'id', $expected, 220);
198 $expected = create_table($link, 'DECIMAL(5,0)', -1000, 1000, $engine, 230);
201 test_format($link, 'id AS order_by_col, FORMAT(col1, 0)', 'test', 'id', $expected, 240);
204 if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
205 printf("[300] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
208 if (mysqli_query($link, "CREATE TABLE `test` (
236 if (!mysqli_query($link, $sql)) {
237 printf("[301] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
245 if (!$stmt = mysqli_stmt_init($link)) {
246 printf("[302] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
251 printf("[303] [%d] %s\n", mysqli_stmt_errno($link), mysqli_stmt_error($link));
256 printf("[304] [%d] %s\n", mysqli_stmt_errno($link), mysqli_stmt_error($link));
261 printf("[305] [%d] %s\n", mysqli_stmt_errno($link), mysqli_stmt_error($link));
268 printf("[305] [%d] %s\n", mysqli_stmt_errno($link), mysqli_stmt_error($link));
284 if (!$stmt = mysqli_stmt_init($link)) {
285 printf("[307] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
290 printf("[308] [%d] %s\n", mysqli_stmt_errno($link), mysqli_stmt_error($link));
295 printf("[309] [%d] %s\n", mysqli_stmt_errno($link), mysqli_stmt_error($link));
300 printf("[310] [%d] %s\n", mysqli_stmt_errno($link), mysqli_stmt_error($link));
307 printf("[311] [%d] %s\n", mysqli_stmt_errno($link), mysqli_stmt_error($link));
325 var_dump(mysqli_error($link));
329 mysqli_close($link);