summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_nonapi.c
diff options
context:
space:
mode:
authorGeorg Richter <georg@php.net>2003-07-18 06:17:39 +0000
committerGeorg Richter <georg@php.net>2003-07-18 06:17:39 +0000
commit13966fdf3e278b676de637b7f060d626c49d63fa (patch)
treec6915e2132e950af3876a1793f0ee333cf8ce045 /ext/mysqli/mysqli_nonapi.c
parent244795a4dfab35407057f5025724d8139a59ef78 (diff)
downloadphp-git-13966fdf3e278b676de637b7f060d626c49d63fa.tar.gz
added new functions:
mysqli_connect_error mysqli_connect_errno which return possible errors for the last connect
Diffstat (limited to 'ext/mysqli/mysqli_nonapi.c')
-rw-r--r--ext/mysqli/mysqli_nonapi.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 86d4fc52a0..b0b6fc9460 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -76,6 +76,7 @@ PHP_FUNCTION(mysqli_connect)
mysql_close(mysql);
RETURN_FALSE;
}
+ php_mysqli_set_error(mysql_errno(mysql), (char *) mysql_error(mysql) TSRMLS_CC);
if (MyG(profiler)) {
prmysql = (PR_MYSQL *)MYSQLI_PROFILER_NEW(prmain, MYSQLI_PR_MYSQL, 0);
@@ -99,6 +100,22 @@ PHP_FUNCTION(mysqli_connect)
}
/* }}} */
+/* {{{ proto int mysqli_connct_errno()
+ Returns the numerical value of the error message from last connect command */
+PHP_FUNCTION(mysqli_connect_errno)
+{
+ RETURN_LONG(MyG(error_no));
+}
+/* }}} */
+
+/* {{{ proto string mysqli_connect_error()
+ Returns the text of the error message from previous MySQL operation */
+PHP_FUNCTION(mysqli_connect_error)
+{
+ RETURN_STRING(MyG(error_msg),1);
+}
+/* }}} */
+
/* {{{ proto array mysqli_fetch_array (object result [,int resulttype])
Fetch a result row as an associative array, a numeric array, or both */
PHP_FUNCTION(mysqli_fetch_array)