Jump to content
[MUST READ] Forum Rules ×

MySQL access through a PHP file


thompa

Recommended Posts

Hi,

Happy New Year


I am a free host user and wonder if anyone can help me to access a MySQL database using a PHP script?
The Script file I am using contains the variables:-

$dbHost="sql106.byethost9.com"; //MySQL server
$dbUnam="b9_2951756"; //temp
$dbPwrd="tennis"; //database password
$dbName="b9_2951756_GTC"; //database name
$dbPfix=""; //db table name prefix (optional)

The variables are taken from the left-hand column of my cPanel and the error produced is:-

MySQL hostname:    "sql106.byethost9.com"
MySQL username:    "b9_2951756" and I use my cPanel Password 

The part I need, that isn't shown in cPanel is the correct 'Database Name'.
When I use the 'MySQL' app (in cPanel) it shows:-
'MySQL DB Name' as "b9_2951756_GTC"
... but using this as above in the variable '$dbName' in my php file, doesn't work and I get the error message:-
'SQL query error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'b9_2951756_GTC._settings' doesn't exist'

Can anyone indicated where I find the correct database name, how how I use what is there?


Thanks in anticipation.
Allan

Edited by thompa
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...