nationavon
MIS
I was using WIN32::ODBC and decided to try DBI::ODBC. This is basically what I have:
use DBI;
$dbh = DBI->connect('dbi:ODBC:helpdesk');
$sqlstatement = "SELECT USER_PASSWORD FROM USERS WHERE USER_NAME='$username'";
$sth = $dbh->prepare($sqlstatement);
$sth->execute || die "Could not execute SQL statement";
$dbpass = $sth->fetchrow_array;
Needless to say this doesn't work. I guess what I need is the most basic syntax for getting a field from a db and assigning it to a variable.
use DBI;
$dbh = DBI->connect('dbi:ODBC:helpdesk');
$sqlstatement = "SELECT USER_PASSWORD FROM USERS WHERE USER_NAME='$username'";
$sth = $dbh->prepare($sqlstatement);
$sth->execute || die "Could not execute SQL statement";
$dbpass = $sth->fetchrow_array;
Needless to say this doesn't work. I guess what I need is the most basic syntax for getting a field from a db and assigning it to a variable.