I am using MySQL via PEAR:DB like this (these statements are executed for
each SQL statement)::

 $dbc = DB::connect( $dsn );
 $cmd = strtoupper(strtok( $str, " " ));
  if ( $cmd == "SELECT" || $cmd == "SHOW" )
  $aRows = ( $queryparms == "" ) ? $dbc->getAll( $str ) : $dbc->getAll(
$str, $queryparms );
 else
  if ( $queryparms == "" )
   $dbc->query( $str );
  else
   $dbc->query( $str, $queryparms );

Everything works just fine.  However, if I do, e.g., 4 UPDATES in a row, the
above statements are executed 4 times and my MySQL log looks like this:

030316 16:30:00    2812 Connect     [EMAIL PROTECTED] on
                   2812 Init DB     VSG_TLI
                   2812 Init DB     VSG_TLI
                   2812 Query       UPDATE vsg SET
VSGSegmentNumber=0,VSGSlideNumber=0,VSGSlideFileName='',VSGQNumber=0 WHERE
VSGCode="VT00001"
                   2812 Init DB     VSG_TLI
                   2812 Init DB     VSG_TLI
                   2812 Query       UPDATE user SET UserIsJoined=0,
UserIsDone=0, UserCurrentSG=UserAssignedSG WHERE UserVSGID = 14
                   2812 Init DB     VSG_TLI
                   2812 Init DB     VSG_TLI
                   2812 Query       UPDATE qcontrol SET
QCPreviousHigh=QCHigh, QCHigh=0 WHERE QCVSGID = 14
                   2812 Init DB     VSG_TLI
                   2812 Init DB     VSG_TLI
                   2812 Query       UPDATE sgstatus SET SGCurrentUser=''
WHERE SGVSGCode='VT00001'
                   2812 Quit

Aren't those double Init DBs an indication of a problem?. I am not using
persistent connections because I'm not clear on what they do.  All of my
users would be using the same DSN, so it seems to me that they'd all be
using the same connection, which doesn't seem like a hot idea.  For that
matter, all the log lines say 2812, so does that mean these in fact all used
the same connection?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to