in reply to Re: Re: DBI/DBD::mysql bugs?
in thread DBI/DBD::mysql bugs?
Table 'players' is defined as followsuse DBD::ODBC; use DBI; my $p = {}; my $t_id = '20'; $p->{P_BATS} = 'R'; $p->{P_THROWS} = 'R'; $p->{P_STATUS} = 'A'; $p->{P_PLAYERID} = 1; my $dbh = DBI->connect('DBI:ODBC:test', 'foo', 'bar', {RaiseError => 1 +}); my $sth = $dbh->prepare(qq/UPDATE players SET t_id=?, bats=?, throws=? +, status=? WHERE id=?/); $sth->execute($t_id, $p->{P_BATS}, $p->{P_THROWS}, $p->{P_STATUS}, $p- +>{P_PLAYERID}); $sth = $dbh->prepare(qq/SELECT * FROM players/); $sth->execute(); while (my @row = $sth->fetchrow_array()){ print join(',', @row),"\n"; } $dbh->disconnect();
test=# \d players Table "players" Attribute | Type | Modifier -----------+-----------------------+---------- id | integer | t_id | character varying(20) | bats | character varying(20) | throws | character varying(20) | status | character varying(20) |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: DBI/DBD::mysql bugs?
by dsb (Chaplain) on Apr 10, 2002 at 02:38 UTC |