List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 10 2002 9:49pm
Subject:Re: (php thing) Bug #17126 Updated: mysql_pconnect() and
mysql_query("LOCK TABLES...") (fwd)
View as plain text  
At 14:29 +0200 5/10/02, Stian Skjelstad wrote:
>I don't know if this is of any interrest etc, but atleast it is a small
>little issue from the big, big world.

This is easily solved by using mysql_connect() rather than
mysql_pconnect().  Then the connection won't stay open if
the script dies or you forget to UNLOCK, and the MySQL
server will automatically unlock.

>---------- Forwarded message ----------
>Date: 10 May 2002 08:41:19 -0000
>From: PHP Bug Database <php-bugs@stripped>
>To: stian@stripped
>Subject: Bug #17126 Updated: mysql_pconnect() and mysql_query("LOCK
>     TABLES...")
>ATTENTION! Do NOT reply to this email!
>To reply, use the web interface found at
>  ID:               17126
>  Updated by:       sander@stripped
>  Reported By:      stian@stripped
>-Status:           Open
>+Status:           Closed
>  Bug Type:         MySQL related
>  Operating System: RedHat Linux 7.2 with updates
>  PHP Version:      4.0CVS-2002-05-09
>  New Comment:
>PHP is not the appropriate place to do this. If you want
>auto-unlocking, bug the MySQL-people or learn to write proper code.
>Previous Comments:
>[2002-05-09 15:08:49] stian@stripped
>This is a test-thing from one of my projects. The problem is the LOCK
>TABLES not beeing unlocked again.. This is a userproblem, but can
>sometimes be hard to track when you rerun the script, and hit another
>Apache-PID and tables still beeing locked.. maybe when a Link
>identifier is destroyed, or new database is selected, an "UNLOCK
>TABLES" should be ommited?
>testsource from project:
>unset ( $ROOT ); $ROOT = "../";
>include_once ( $ROOT."include/setup.php" );
>include_once ( $INCLUDE."mysql.php" );
>echo "Locking...";
>mysql_query("LOCK TABLES Ansatt WRITE;");
>echo "Done (".mysql_error().")<br>";
>Before posting, please check:
>   (the manual)
>           (the list archive)
>To request this thread, e-mail <mysql-thread108606@stripped>
>To unsubscribe, e-mail <>
>Trouble unsubscribing? Try:

(php thing) Bug #17126 Updated: mysql_pconnect() and mysql_query("LOCKTABLES...") (fwd)Stian Skjelstad10 May
  • Re: (php thing) Bug #17126 Updated: mysql_pconnect() andmysql_query("LOCK TABLES...") (fwd)Paul DuBois10 May