mysqli_real_escape_string () espera exactamente 2 parámetros
Publicado por alberto (15 intervenciones) el 21/03/2019 18:32:37
Buenas tardes comunidad tengo una inquietud tengo estos este error
Advertencia : mysqli_real_escape_string () espera exactamente 2 parámetros, 1 en /home/u195606881/public_html/_product-add.php en la línea 10
Advertencia : mysqli_real_escape_string () espera exactamente 2 parámetros, 1 en / home / u195606881 / public_html / -add.php en la línea 10 La columna 'nombre_producto' no puede ser nula
Este es el código con el cual estoy trabajando no se que estoy haciendo mal,cabe aclara que utilizando mysql si me sirve sabiendo que ya esta obsoleto y se utilizo ahora mysqli me sale el error
Mi conexión a la base de datos es $cn;
Advertencia : mysqli_real_escape_string () espera exactamente 2 parámetros, 1 en /home/u195606881/public_html/_product-add.php en la línea 10
Advertencia : mysqli_real_escape_string () espera exactamente 2 parámetros, 1 en / home / u195606881 / public_html / -add.php en la línea 10 La columna 'nombre_producto' no puede ser nula
Este es el código con el cual estoy trabajando no se que estoy haciendo mal,cabe aclara que utilizando mysql si me sirve sabiendo que ya esta obsoleto y se utilizo ahora mysqli me sale el error
Mi conexión a la base de datos es $cn;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysqli_real_escape_string") ? mysqli_real_escape_string( $theValue) : mysqli_escape_string($cn, $theValue);
switch ($theType) { case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
} return $theValue;
}
}
Valora esta pregunta


0