/hphp/test/slow/ext_mysql/mysql_fetch_lengths.php
PHP | 29 lines | 23 code | 5 blank | 1 comment | 0 complexity | ed676e837729da7984689f467025b089 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?hh
- require_once('connect.inc');
- <<__EntryPoint>> function main(): void {
- $conn = mysql_connect($host, $user, $passwd);
- var_dump(create_test_table('lengths'));
- var_dump(mysql_query(
- "insert into test_lengths (name) values ('test'),('test2')"));
- $res = mysql_query('select * from test_lengths');
- $row = mysql_fetch_row($res);
- $lengths = mysql_fetch_lengths($res);
- print_r($lengths);
- // A much more intense test on lengths
- mysql_query('drop table testlen');
- var_dump(mysql_query("create table testlen (id int not null auto_increment, " .
- "d decimal(10,5), t tinyint, i int, b bigint, f float, " .
- "db double, y2 year(2), y4 year(4), primary key (id)) " .
- "engine=innodb"));
- var_dump(mysql_query("insert into testlen(d, t, i, b, f, db, y2, y4) values" .
- "(.343, null, 384, -1, 03.44, -03.43892874e101, 00, 0000)"));
- $res = mysql_query('select * from testlen');
- $row = mysql_fetch_row($res);
- $lengths = mysql_fetch_lengths($res);
- print_r($lengths);
- }