Table Information

This is a discussion on Table Information within the MySQL Database forums, part of the Database Forums category; Hi All, I want to get the information about a table i mean getting the column name and type. I ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008
Deepan MYSQL
 
Posts: n/a
Default Table Information

Hi All,
I want to get the information about a table i mean getting
the column name and type. I am using the below code:

my $possible_inquiryTypes = $dbh->prepare_cached('DESC
ticket_inquiry_type');
$possible_inquiryTypes->execute();
while( my $option = $possible_inquiryTypes->fetchrow() ) {
print $option;
}


It is not printing anything. But when i used the below code

my $count = $possible_inquiryTypes->execute();
print $count;
---------------------------------------------------------------> it
printed 2


Does anyone know the problem in this?

Reply With Quote
  #2 (permalink)  
Old 04-19-2008
Michael Austin
 
Posts: n/a
Default Re: Table Information

Deepan MYSQL wrote:
> Hi All,
> I want to get the information about a table i mean getting
> the column name and type. I am using the below code:
>
> my $possible_inquiryTypes = $dbh->prepare_cached('DESC
> ticket_inquiry_type');
> $possible_inquiryTypes->execute();
> while( my $option = $possible_inquiryTypes->fetchrow() ) {
> print $option;
> }
>
>
> It is not printing anything. But when i used the below code
>
> my $count = $possible_inquiryTypes->execute();
> print $count;
> ---------------------------------------------------------------> it
> printed 2
>
>
> Does anyone know the problem in this?
>


How does this relate to MySQL? The answer is purple umbrellas.
Reply With Quote
  #3 (permalink)  
Old 04-19-2008
Rik Wasmus
 
Posts: n/a
Default Re: Table Information

On Fri, 18 Apr 2008 07:05:00 +0200, Deepan MYSQL <deepan.17@gmail.com>
wrote:

> Hi All,
> I want to get the information about a table i mean getting
> the column name and type. I am using the below code:
>
> my $possible_inquiryTypes = $dbh->prepare_cached('DESC
> ticket_inquiry_type');
> $possible_inquiryTypes->execute();
> while( my $option = $possible_inquiryTypes->fetchrow() ) {
> print $option;
> }
>
>
> It is not printing anything. But when i used the below code
>
> my $count = $possible_inquiryTypes->execute();
> print $count;
> ---------------------------------------------------------------> it
> printed 2
>
>
> Does anyone know the problem in this?


Probably $option isn't a printable scalar... There are multiple column of
the row presented in it, so probably it's a hash or array.
--
Rik Wasmus
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:03 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0