php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
mysqli_report.c
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Author: Georg Richter <georg@php.net> |
14 +----------------------------------------------------------------------+
15*/
16
17#ifdef HAVE_CONFIG_H
18#include <config.h>
19#endif
20
21#include "php.h"
22#include "php_mysqli_structs.h"
23
24extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format, ...);
25
26/* {{{ sets report level */
40/* }}} */
41
42/* {{{ void php_mysqli_report_error(char *sqlstate, int errorno, char *error) */
43void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error)
44{
45 php_mysqli_throw_sql_exception((char *)sqlstate, errorno, "%s", error);
46}
47/* }}} */
48
49/* {{{ void php_mysqli_report_index() */
50void php_mysqli_report_index(const char *query, unsigned int status) {
51 char index[15];
52
54 strcpy(index, "Bad index");
56 strcpy(index, "No index");
57 } else {
58 return;
59 }
60 php_mysqli_throw_sql_exception("00000", 0, "%s used in query/prepared statement %s", index, query);
61}
62/* }}} */
DNS_STATUS status
Definition dns_win32.c:49
error($message)
Definition ext_skel.php:22
mysqli_report(int $flags)
void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error)
void php_mysqli_report_index(const char *query, unsigned int status)
void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format,...)
#define SERVER_QUERY_NO_INDEX_USED
#define SERVER_QUERY_NO_GOOD_INDEX_USED
#define PHP_FUNCTION
Definition php.h:364
zend_long report_mode
#define MyG(v)
char sqlstate[6]
ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec,...)
Definition zend_API.c:1300
#define ZEND_NUM_ARGS()
Definition zend_API.h:530
#define RETURN_THROWS()
Definition zend_API.h:1060
#define RETURN_TRUE
Definition zend_API.h:1059
int32_t zend_long
Definition zend_long.h:42
@ FAILURE
Definition zend_types.h:61