$tmp = NULL;
$link = NULL;
+ if ($socket)
+ $host = sprintf("%s:%s", $host, $socket);
+ else if ($port)
+ $host = sprintf("%s:%s", $host, $port);
+
function connect($host, $user, $passwd) {
$conn = mysql_pconnect($host, $user, $passwd);
if (!$conn)
Warning: mysql_ping(): MySQL server has gone away in %s on line %d
reconnect
OK
-done!
\ No newline at end of file
+done!
mysql_close($plink);
- if (!($plink = mysql_pconnect($myhost, $user, $passwd)))
+ if (!($plink = @mysql_pconnect($myhost, $user, $passwd)))
printf("[009] Cannot create new persistent connection, [%d] %s\n", mysql_errno(), mysql_error());
mysql_select_db($db, $plink);
if (!((start[1] ^ 0x80) < 0x40 &&
(start[2] ^ 0x80) < 0x40 &&
(start[3] ^ 0x80) < 0x40 &&
- (c >= 0xf1 || start[1] >= 0x90) &&
- (c <= 0xf3 || start[1] <= 0x8F)))
+ (c >= 0xf1 || start[1] >= (char)0x90) &&
+ (c <= 0xf3 || start[1] <= (char)0x8F)))
{
return 0; /* invalid utf8 character */
}