Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22924 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21106 invoked by uid 1010); 22 Apr 2006 04:51:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21091 invoked from network); 22 Apr 2006 04:51:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Apr 2006 04:51:37 -0000 X-Host-Fingerprint: 69.2.42.244 unknown Linux 2.4/2.6 Received: from ([69.2.42.244:43572] helo=users.smashlabs.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 29/D8-19715-856B9444 for ; Sat, 22 Apr 2006 00:51:36 -0400 Received: (qmail 7815 invoked by uid 210); 21 Apr 2006 23:51:10 -0500 Received: from 66.69.236.63 by users.smashlabs.com (envelope-from , uid 201) with qmail-scanner-1.24st (perlscan: 1.24st. Clear:RC:0(66.69.236.63):. Processed in 0.069053 secs); 22 Apr 2006 04:51:10 -0000 X-Qmail-Scanner-Mail-From: ralph@smashlabs.com via users.smashlabs.com X-Qmail-Scanner: 1.24st (Clear:RC:0(66.69.236.63):. Processed in 0.069053 secs Process 32497) Received: from cpe-66-69-236-63.austin.res.rr.com (HELO ?10.20.0.133?) (ralph@smashlabs.com@66.69.236.63) by 244.42.ntg.com with AES256-SHA encrypted SMTP; 21 Apr 2006 23:51:10 -0500 Message-ID: <4449B766.50109@smashlabs.com> Date: Fri, 21 Apr 2006 23:56:06 -0500 User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: PDO MySQL - show create table From: ralph@smashlabs.com (Ralph Schindler) Is it not possible to run the "show create table __" via PDO? I swear I was able to do this in the past, and for some reason this is not working. Am I doing something wrong, is this a bug, or is this planned? Pasted below is the mysql command and result expected, test code, and its result. -ralph #### PROOF THE COMMAND WORKS ralph@localhost ~/development/code/php5.1-200604220230 $ echo "show create table blog_comments" | mysql -u root --password=xxxxxx test Table Create Table blog_comments CREATE TABLE `blog_comments` (\n `id` int(11) NOT NULL auto_increment,\n `blog_entry_id` int(11) NOT NULL,\n `comment` text NOT NULL,\n `comment_datetime` datetime NOT NULL,\n PRIMARY KEY (`id`),\n KEY `FK_blog_comments_1` (`blog_entry_id`),\n CONSTRAINT `FK_blog_comments_1` FOREIGN KEY (`blog_entry_id`) REFERENCES `blog_entries` (`id`) ON DELETE CASCADE ON UPDATE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 #### THE TEST SCRIPT ralph@localhost ~/development/code/php5.1-200604220230 $ cat /home/ralph/development/vhosts/ralphschindler.com/development/test_show.php prepare("SHOW CREATE TABLE blog_comments"); $stmt->execute(); print_r($stmt); echo "\n"; $result = $stmt->fetchAll(PDO::FETCH_ASSOC); print_r($result); echo "no exceptions\n"; } catch (Exception $e) { echo $e->getMessage(); echo "exception"; } echo "\n\nTEST QUERY--------\n"; try { $thing = $db->query("SHOW CREATE TABLE blog_comments"); print_r($thing); echo "\n"; echo "no exception\n"; } catch (Exception $e) { echo $e->getMessage(); echo "exception"; } #### TEST SCRIPT OUTPUT ralph@localhost ~/development/code/php5.1-200604220230 $ ./sapi/cli/php /home/ralph/development/vhosts/ralphschindler.com/development/test_show.php TEST PREPARED------- PDOStatement Object ( [queryString] => SHOW CREATE TABLE blog_comments ) Array ( ) no exceptions TEST QUERY-------- no exception