2
Wore mysql_query
, as it is no longer used I am using the MySQLi
.
That left me with a question.
To display query error by DIE
that’s how you do it?
$sql = $mysqli->query("SELECT * Fron tabela") or die(mysqli_error();
Thank you.
2
Wore mysql_query
, as it is no longer used I am using the MySQLi
.
That left me with a question.
To display query error by DIE
that’s how you do it?
$sql = $mysqli->query("SELECT * Fron tabela") or die(mysqli_error();
Thank you.
5
Avoid mixing Mysqli procedural and OO style, maintain consistency
In object oriented the correct form is through the property $error
$sql = $mysqli->query("SELECT * FROM tabela") or die($mysqli->error);
In the procedural you are required to pass the connection to the function:
$sql = mysqli_query($conexao, "SELECT * FROM tabela") or die(mysqli_error($conexao));
Browser other questions tagged php mysql mysqli
You are not signed in. Login or sign up in order to post.
We’re missing a
)
before the;
, but the concept is the same.– Marco Aurélio Deleu
Exchange tbm this "Fron". The correct SQL syntax is "From"
– DiChrist
@Diegodesouzasilva, curiously, the
fron
there may be purpose to cause the error and see if themysqli_error()
works :P haha– rray
hahaah is even believe kkk, had not even called me kkk
– DiChrist
@rray still someone edited and was approved...
– Jorge B.