summaryrefslogtreecommitdiff
path: root/ext/mysqli
diff options
context:
space:
mode:
authorGeorg Richter <georg@php.net>2003-12-13 16:08:13 +0000
committerGeorg Richter <georg@php.net>2003-12-13 16:08:13 +0000
commitec5b38fae9b03c1465e4dd91351d6ea69850f9e3 (patch)
tree6c1813e1dcd4e3ea6eaa994526069494249e4be7 /ext/mysqli
parent47a32a57e80e721b93189f86f0ed57d8e1efa8b1 (diff)
downloadphp-git-ec5b38fae9b03c1465e4dd91351d6ea69850f9e3.tar.gz
minor fixes for embedded
Diffstat (limited to 'ext/mysqli')
-rw-r--r--ext/mysqli/mysqli_api.c9
-rw-r--r--ext/mysqli/mysqli_nonapi.c6
2 files changed, 7 insertions, 8 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 48dd6a3734..cd5bf9bc4e 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -936,7 +936,7 @@ PHP_FUNCTION(mysqli_get_host_info)
}
MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link");
- RETURN_STRING((char *)mysql_get_host_info(mysql), 1);
+ RETURN_STRING((mysql->host_info) ? mysql->host_info : empty_string, 1);
}
/* }}} */
@@ -995,7 +995,6 @@ PHP_FUNCTION(mysqli_get_server_version)
PHP_FUNCTION(mysqli_info)
{
MYSQL *mysql;
- char *info = NULL;
zval *mysql_link = NULL;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
@@ -1003,11 +1002,7 @@ PHP_FUNCTION(mysqli_info)
}
MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link");
- if (!(info = (char *)mysql_info(mysql))) {
- RETURN_FALSE;
- }
-
- RETURN_STRING(info, 1);
+ RETURN_STRING((mysql->info) ? mysql->info : empty_string, 1);
}
/* }}} */
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 34bf332953..2a50d773c8 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -116,8 +116,12 @@ PHP_FUNCTION(mysqli_embedded_connect)
mysql = mysql_init(NULL);
if (mysql_real_connect(mysql, NULL, NULL, NULL, dbname, 0, NULL, 0) == NULL) {
+ MYSQLI_REPORT_MYSQL_ERROR(mysql);
php_mysqli_set_error(mysql_errno(mysql), (char *) mysql_error(mysql) TSRMLS_CC);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", mysql_error(mysql));
+
+ if (!(MyG(report_mode) & MYSQLI_REPORT_ERROR)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", mysql_error(mysql));
+ }
/* free mysql structure */
mysql_close(mysql);
RETURN_FALSE;