Issue Selecting Row from Mysql with mysqli_connect() on production

CodeTalk

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.

vaso123
  • 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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

mySQL - Selecting the latest row from a table

From Dev

MySQL - selecting random row from large table

From Dev

Selecting first row in UIPickerView issue

From Dev

Selecting first row in UIPickerView issue

From Dev

mysql selecting room types issue

From Dev

MySQL selecting row for attendance case

From Dev

Datagrid Issue With Selecting One Cell Out Of A Row

From Dev

Selecting row from table in laravel

From Dev

Selecting largest number from row

From Dev

use mysqli_connect and mysql_select_db

From Dev

PHP: Is it possible to create a MySQL connection with a function returning mysqli_connect()?

From Dev

Inserting Into a Row and Then Selecting from that Row in One Query

From Dev

Deleting a ROW from MySQL database using MySQLi

From Dev

mySQL is not selecting the values of the row with the MAX date

From Dev

MySQL selecting multi ids values in one row

From Dev

MYSQL - Selecting multiple rows in a single row

From Dev

MYSQL selecting from 3 tables

From Dev

MySQL selecting from multiple tables

From Dev

MySQL selecting from multiple tables

From Dev

MySQL Selecting from multiple rows

From Dev

Selecting records from database mysql

From Dev

Can't connect using mysqli_connect, but mysql_connect works..?

From Dev

KDB selecting first row from each group

From Dev

Selecting a row from a Kendo Grid programmatically

From Dev

Selecting row from Table - Java Selenium

From Dev

Randomly selecting a row for a specific column from CSV

From Dev

selecting the same data in different row from database

From Dev

mysqli_connect(): (HY000/2003): Can't connect to MySQL server on 'domain name' (111)

From Dev

Can't connect to my MySQL database using PHP mysqli_connect()

Related Related

HotTag

Archive