1--TEST-- 2MySQL PDOStatement->rowCount() @ SELECT 3--EXTENSIONS-- 4pdo_mysql 5--SKIPIF-- 6<?php 7require_once __DIR__ . '/inc/mysql_pdo_test.inc'; 8MySQLPDOTest::skip(); 9?> 10--FILE-- 11<?php 12 require_once __DIR__ . '/inc/mysql_pdo_test.inc'; 13 $db = MySQLPDOTest::factory(); 14 15 $table = 'pdo_mysql_stmt_rowcount'; 16 MySQLPDOTest::createTestTable($table, $db); 17 18 try { 19 20 if (0 !== ($tmp = $db->query("SELECT id FROM {$table} WHERE 1 = 0")->rowCount())) 21 printf("[002] Expecting 0 got %s", var_export($tmp, true)); 22 23 if (1 !== ($tmp = $db->query("SELECT id FROM {$table} WHERE id = 1")->rowCount())) 24 printf("[003] Expecting 1 got %s", var_export($tmp, true)); 25 26 } catch (PDOException $e) { 27 printf("[001] %s [%s] %s\n", 28 $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo())); 29 } 30 31 print "done!"; 32?> 33--CLEAN-- 34<?php 35require_once __DIR__ . '/inc/mysql_pdo_test.inc'; 36$db = MySQLPDOTest::factory(); 37$db->exec('DROP TABLE IF EXISTS pdo_mysql_stmt_rowcount'); 38?> 39--EXPECT-- 40done! 41