PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Table Information
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Table Information

Réponse
 
LinkBack Outils de la discussion
Vieux 18/04/2008, 06h05   #1
Deepan MYSQL
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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?

  Réponse avec citation
Vieux 19/04/2008, 03h12   #2
Michael Austin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.
  Réponse avec citation
Vieux 19/04/2008, 13h22   #3
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h50.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08492 seconds with 11 queries