bazz
07-20-2006, 03:30 PM
Hi,
Still a newbie to mySQL.
I want to query a specific table in the Db and output all the filed names to my perl script. This is for building a web form on the fly for adding new subscribers.
I am confused between building an array of the fields info and, querying using a $query variable.
here is the query code so far.
my $db = 'this';
my $server = 'that';
my $port = '1234';
my $user = 'theOther';
my $pass = 'another';
my $fieldsInAccountsTable;
my $dbh = DBI->connect("DBI:mysql:$db:$server:$port", $user, $pass,
{RaiseError => 1, PrintError => 0, AutoCommit => 1})
or die "Can't connect: DBI->errstr()";
my $fieldsInAccountTable = I'm stuck here
# disconnect from the MySQL server
$dbh->disconnect();
Bazz
Still a newbie to mySQL.
I want to query a specific table in the Db and output all the filed names to my perl script. This is for building a web form on the fly for adding new subscribers.
I am confused between building an array of the fields info and, querying using a $query variable.
here is the query code so far.
my $db = 'this';
my $server = 'that';
my $port = '1234';
my $user = 'theOther';
my $pass = 'another';
my $fieldsInAccountsTable;
my $dbh = DBI->connect("DBI:mysql:$db:$server:$port", $user, $pass,
{RaiseError => 1, PrintError => 0, AutoCommit => 1})
or die "Can't connect: DBI->errstr()";
my $fieldsInAccountTable = I'm stuck here
# disconnect from the MySQL server
$dbh->disconnect();
Bazz