2004-01-12 02:31:08 +00:00
|
|
|
--TEST--
|
|
|
|
mysql connect
|
2004-01-16 15:16:26 +00:00
|
|
|
--SKIPIF--
|
|
|
|
<?php include 'skipif.inc'; ?>
|
2004-01-12 02:31:08 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2007-10-10 09:47:21 +00:00
|
|
|
require_once('connect.inc');
|
2004-01-12 02:31:08 +00:00
|
|
|
$test = '';
|
|
|
|
|
2007-10-10 09:47:21 +00:00
|
|
|
if ($socket)
|
|
|
|
$host = sprintf("%s:%s", $host, $socket);
|
|
|
|
else if ($port)
|
|
|
|
$host = sprintf("%s:%s", $host, $port);
|
|
|
|
|
2004-01-12 02:31:08 +00:00
|
|
|
/*** test mysql_connect localhost ***/
|
|
|
|
$db = mysql_connect($host, $user, $passwd);
|
|
|
|
$test .= ($db) ? '1' : '0';
|
|
|
|
mysql_close($db);
|
|
|
|
|
|
|
|
/*** test mysql_connect localhost:port ***/
|
2007-10-10 09:47:21 +00:00
|
|
|
$db = mysql_connect($host, $user, $passwd, true);
|
2004-01-12 02:31:08 +00:00
|
|
|
$test .= ($db) ? '1' : '0';
|
|
|
|
mysql_close($db);
|
|
|
|
|
|
|
|
var_dump($test);
|
2007-10-10 09:47:21 +00:00
|
|
|
print "done!";
|
2004-01-12 02:31:08 +00:00
|
|
|
?>
|
2009-07-01 15:33:31 +00:00
|
|
|
--EXPECTF--
|
|
|
|
%unicode|string%(2) "11"
|
2007-10-10 09:47:21 +00:00
|
|
|
done!
|