001.phpt 916 B

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