xref: /PHP-5.6/ext/mysql/tests/001.phpt (revision b7091aaf)
1--TEST--
2mysql connect
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10require_once('connect.inc');
11$test = '';
12
13if ($socket)
14	$host = sprintf("%s:%s", $host, $socket);
15else if ($port)
16	$host = sprintf("%s:%s", $host, $port);
17
18/*** test mysql_connect localhost ***/
19$db = mysql_connect($host, $user, $passwd);
20$test .= ($db) ? '1' : '0';
21mysql_close($db);
22
23/*** test mysql_connect localhost:port ***/
24$db = mysql_connect($host, $user, $passwd, true);
25$test .= ($db) ? '1' : '0';
26mysql_close($db);
27
28var_dump($test);
29print "done!";
30?>
31--EXPECTF--
32Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d
33
34Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d
35%unicode|string%(2) "11"
36done!
37