database connectivity problem

Status
Not open for further replies.

itsqksex

New Member
Messages
2
Reaction score
0
Points
1
BEEN GETTING THIS ERROR BTW IM USING CODEIGNITER

Error Number: 1142

SELECT command denied to user 'itsqksex_sample'@'localhost' for table 'reservation'

SELECT `RESERVATION_ID` FROM `u994227601_itsq`.`reservation` `A` WHERE `RESERVATION_DATE` = '2017-09-10'

Filename: models/Reservation_model.php

Line Number: 88

even though my code is

$db['default'] = array(
'dsn' => '',
'hostname' => "localhost",
'username' => "itsqksex_sample",
'password' => "*******",
'database' => "itsqksex_sample",
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);

AND I'VE SET PRIVILEGES TO GRANT ALL
 

Anna

I am just me
Staff member
Messages
11,772
Reaction score
591
Points
113
I'd assume this `u994227601_itsq`.`reservation part should read something like 'itsqksex_sample'.'reservation' given that you put itsqksex_sample as the database in your config you pasted.

All databases, and database users, should be prefixed with your cPanel id with us.

The point with having the database name as a variable is to use the variable in the code so that there's no hard coded parts that could potentially change if you switch hosts for instance.
 
Status
Not open for further replies.
Top