Created new user and can't select database - MySQL PHP
Problem - Created new user with 'minimal' permissions and when I plug in
the account info I get the error 'No Database Selected'
In MySQL Workbench I can connect to the database and select data. But not
through PHP.
Permissions - SELECT, INSERT, UPDATE, CREATE TEMPORARY TABLES, LOCK TABLES
$db_select = mysql_select_db('DBNAME',$conn);
if($db_select){
$sql = "SELECT * FROM TABLE1 LIMIT 1";
if ($result = mysql_query($sql)) {
$row = mysql_fetch_assoc($result);
}
else print mysql_error();
}
No comments:
Post a Comment