Re: Help Required regarding Database Operations
- From: Tim.Bunce@xxxxxxxxx (Tim Bunce)
- Date: Thu, 29 Dec 2005 17:34:29 +0000
On Thu, Dec 29, 2005 at 06:26:59AM +0000, Bhavin Shah wrote:
> I am a novice user to PERL. Plz help me regarding
> following information
> Suppose there is a MySQL DB say X, with Server Y, User
> XY, Password XYZ and Table ABC.
> How do i get fieldsNAmes of a Table in a Array?
Something like
use DBI;
$dbh = DBI->connect("dbi:mysql:host=Y;database=X", "XY", "XYZ");
then either use the column_info() method or, if you're going to be
selecting from the table anyway, you could
$sth = $dbh->prepare("select * from Table");
@fieldsNAmes = @{$sth->{NAME}}; # or NAME_lc or NAME_uc
> Also for PHP as we have phpinfo() function, what is a
> similar function in PERL?
Perhaps the Config module has whatever it is you're looking for.
See also http://www.catb.org/~esr/faqs/smart-questions.html
Tim.
.
- References:
- Help Required regarding Database Operations
- From: Bhavin Shah
- Help Required regarding Database Operations
- Prev by Date: Re: Help Required regarding Database Operations
- Next by Date: Re: DBI 1.50 - make problems (cc1: Invalid option)
- Previous by thread: Re: Help Required regarding Database Operations
- Next by thread: DBD::SQLite & accented chars
- Index(es):
Relevant Pages
|