Hi,
I am trying to read the field types (as well as 1 row of data and the
field names), but I cannot seem to manage it. Any ideas on how?
M.
$sth = $dbh->prepare("SELECT * FROM $sqlTable WHERE id = $id");
$sth->execute;
my $hash_ref = $sth->fetchrow_hashref;
my @staffFields = keys(%{$hash_ref});
my @staffValues = values(%{$hash_ref});
my @types = $sth->type;
#if ($sth->type->[0] = &Mysql::FIELD_TYPE_STRING) {
# print "Name is a STRING!!<br>";
#}
$count=-1;
foreach (@staffFields) {
$count++;
print $_ . " --> " . $staffValues[$count] . "<br>";
}
--
He came from Econet - Oh no, I've run out of underpants :(
Home:- [EMAIL PROTECTED] http://www.wizdom.org.uk
Shadow:- [EMAIL PROTECTED] http://www.shadow.org.uk
Work:- [EMAIL PROTECTED] http://www.hinwick.demon.co.uk
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php