I'm refactoring an existing application which is using old methods to connect and interact with a mysql database like mysql_connect(
) and mysql_fetch_array
which had code like:
Update The only output Im getting on the page is the below, which are empty arrays.
Array ( [initial] => Array ( ) [additional] => Array ( ) )
Final update This was an issue with the root user not having access to %. I was getting an error like: The user specified as a definer ('root'@'%') does not exist
on output this is fixed by running the command:
grant all on *.* to 'root'@'%' identified by 'password' with grant option;
The reason for converting was using the originally coded use of mysql_connect()
(not by me) does not work (as far as I know) with mysql when you have remote connections turned off (which I do).
Why isn't my new code outputting anything? The original code above works in development env. where remote connections is turned off, but not in production.
Thank you.
Your class has a missing closing bracket }
at the end.
You do not select database
Why do you create $this->dbConn
everywhere, you defined it in your constructor.
Where is your $this->dbConn->query
defined? $this->dbConn
is a resource of connection.
NOTE
Add error_reporting(E_ALL);
and ini_set('display_errors', 1);
to catch your errors.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments