in reply to Re^3: Updating or Inserting a database from a txt file
in thread Updating or Inserting a database from a txt file
You can do that, for example, using
The finish tells DBI and the DB you no longer need this instance of the statement handle query. You normally have to call this after a SELECT query where you don't try to deplete the statement handle, fetching rows, thus until it returns undef.$select->execute($gamename); my($rows) = $select->fetchrow_array; # first row $select->finish; # premature abort: no more rows if($rows) { # found $update->execute( $gamedesc, $gamecount, $gamename ); } else { $insert->execute( $gamename, $gamedesc, 0 ); }
BTW untested, I hope I got it right! :)
|
|---|