I have this code and can not see error in it, but it gives me this error. I know there should already be a topic of this on the site but I have tried all the ways and nothing. Give me the bool error (false)
I have this code and can not see error in it, but it gives me this error. I know there should already be a topic of this on the site but I have tried all the ways and nothing. Give me the bool error (false)
This error happens when %code% or %code% fails, it is usually a syntax error in the sql query and returns a %code% as explained in manual . For mysql_fetch _ * () to function properly you must pass a variable of type %code% or %code% which is the return of %code% / %code% on success.
To fix the error you can force mysql_ * mysqli _ mysqli _ to display the database error with the mysql_error () or mysqli_error ()
Version with old mysql functions _ *
%pre%Version with mysqli_ * procedural
%pre%Version with mysqli_ * OO
%pre%The query will return this error because %code% is a reserved mysql word.
Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc'
The other way is to print the query and test directly at the database:
%pre%Related:
Why should not we use functions of type mysql_ *?
The problem occurs because the %code% method needs a parameter with the connection to the database.
I leave an example below. Remember to modify the data to connect to the bank.
I leave it as a hint for you to study using the PDO because it is safer and the %code% is already depreciated.
%pre%Example: