Constant error with this app note, On Bluehost
Connection failed: Access denied for user ‘bill’@’localhost’ (using password: YES)
SQL Query
CREATE TABLE sensor_data (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
value1 VARCHAR(10),
value2 VARCHAR(10),
value3 VARCHAR(10),
reading_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)
I copy and pasted the text for both of the PHP files, Database name, username, and password verified multiple times.
$value1 = json_encode(array_reverse(array_column($sensor_data, ‘value1’)), JSON_NUMERIC_CHECK);
$value2 = json_encode(array_reverse(array_column($sensor_data, ‘value2’)), JSON_NUMERIC_CHECK);
$value3 = json_encode(array_reverse(array_column($sensor_data, ‘value3’)), JSON_NUMERIC_CHECK);
$reading_time = json_encode(array_reverse($readings_time), JSON_NUMERIC_CHECK);
http://example.com/post-data.php
is functional
http://example.com/esp-chart.php
fails with access denied
I have repeated Bluehost cpanel configuration 4 separate times, every attempt fails
on the esp=chart test.
Suggestions ?
App note is incorrect on database naming. The Bluehost database creation app prefixes the database name and username with (in my case ) “compuwe6_” and limits username to 7 characters. Subsequently in the PHP file creation this prefix has to be added to the credentials IE:
// REPLACE with your Database name
$dbname = “compuwe6_esp_data”;
// REPLACE with Database user
$username = “compuwe6_espbrd”;
If you follow the application note very closely, you will go down the rabbit hole, and the PHP will fail with the above listed error. Everything will look correct code-wise, but since the application note directly references Bluehost for the build, it should be updated to correctly reflect the the IDE environment.
I am a newbie to this type of development, 30+ years of C, but new to web based applications.