You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ken Williams <ke...@forum.swarthmore.edu> on 2000/07/13 01:41:45 UTC

Re: [OT] DBI:mysql question

chip@zfx.com (Chip Turner) wrote:
>A one-line example of this can be tested by running the following in
>two shell windows:
>
>$ perl -MDBI -e 'my $dbh = DBI->connect("DBI:mysql:mysql", "yy", "xx"); 
>  my $sth = $dbh->prepare("SELECT GET_LOCK(\"mysql\", 5)"); $sth->execute;
>  my ($lock) = $sth->fetchrow; print "lock: $lock\n"; sleep 10'

Is there a reason not to use selectrow_array for locks?  

$ perl -MDBI -e 'my ($lock) = DBI->connect("DBI:mysql:mysql", "yy", "xx")
  ->selectrow_array("SELECT GET_LOCK(\"mysql\", 5)"); 
  print "lock: $lock\n"; sleep 10'


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum