mysqli::real_query

mysqli_real_query

(PHP 5, PHP 7, PHP 8)

mysqli::real_query -- mysqli_real_queryEjecuta una consulta SQL

Descripción

Estilo orientado a objetos

public mysqli::real_query(string $query): bool

Estilo por procedimientos

mysqli_real_query(mysqli $mysql, string $query): bool

Ejecuta una sola consulta en la conexión a la base de datos representada por el parámetro link cuyo resultado puede ser recuperado o almacenado utilizando las funciones mysqli_store_result() o mysqli_use_result().

Advertencia

Security warning: SQL injection

If the query contains any variable input then parameterized prepared statements should be used instead. Alternatively, the data must be properly formatted and all strings must be escaped using the mysqli_real_escape_string() function.

Para determinar si una consulta dada debería haber devuelto un conjunto de resultados o no, consulte la función mysqli_field_count().

Parámetros

link

Sólo estilo por procediminetos: Un identificador de enlace devuelto por mysqli_connect() o mysqli_init()

query

La consulta string.

Valores devueltos

Devuelve true en caso de éxito o false en caso de error.

Errores/Excepciones

If mysqli error reporting is enabled (MYSQLI_REPORT_ERROR) and the requested operation fails, a warning is generated. If, in addition, the mode is set to MYSQLI_REPORT_STRICT, a mysqli_sql_exception is thrown instead.

Ver también

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top