|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|