I have the next code (compilated in NetBeans)
$query = 'INSERT INTO grupos(nombre, descripcion)'
. ' VALUES ("' . utf8_decode($_POST['name']) . '", "' . utf8_decode($_POST['desc']) . '")';
$result = $con->query($query) or exit("Error: " . $con->errno . ": " . $con->error);
if ($result->affected_rows > 0) {
Why I got this: "Trying to get property of non-object " if when I made a echo $result; display a '1'?