<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
+require_once('skipifdefaultconnectfailure.inc');
?>
--FILE--
<?php
$tmp = NULL;
$link = NULL;
-if (false !== ($tmp = @mysql_affected_rows()))
- printf("[001] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
+if (0 !== ($tmp = @mysql_affected_rows()))
+ printf("[001] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp);
if (null !== ($tmp = @mysql_affected_rows($link)))
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
+require_once('skipifdefaultconnectfailure.inc');
?>
--FILE--
<?php
$tmp = NULL;
$link = NULL;
-if (false !== ($tmp = @mysql_insert_id()))
- printf("[001] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
+if (0 !== ($tmp = @mysql_insert_id()))
+ printf("[001] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp);
if (NULL !== ($tmp = @mysql_insert_id($link)))
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
--- /dev/null
+<?php
+if ($skip_on_connect_failure) {
+ if (!$link = @mysql_connect())
+ die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
+
+ if (!@mysql_select_db($db, $link))
+ die(sprintf("skip Can't connect to MySQL Server with default credentials - [%d] %s", mysql_errno(), mysql_error()));
+
+ mysql_close($link);
+}
+?>