PageRenderTime 40ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/bad/ext/pdo_mysql/tests/last_insert_id.php

http://github.com/facebook/hiphop-php
PHP | 11 lines | 7 code | 4 blank | 0 comment | 0 complexity | e01b2e0795c3c5194a9fb536dfd6d10d 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
  1. <?php
  2. require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
  3. $db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
  4. print_r($db->query("CREATE TABLE test (id int auto_increment primary key, num int)"));
  5. print_r($db->query("INSERT INTO test (id, num) VALUES (23, 42)"));
  6. print_r($db->query("INSERT INTO test (num) VALUES (451)"));
  7. print_r($db->lastInsertId());