I have problems with this simple SELECT command, I’ve already selected which database in my sql connection string, but it seems to think that the “cellnames” in my table is a database, and “rnc” is the tablename, right?
$data = mysql_query("
SELECT * FROM cellnames.rnc
") or die(mysql_error());
This outputs:
“SELECT command denied to user ”@’localhost’ for table ‘rnc'”
However, the table name is “cellnames”, and the column is “rnc”. How come it works this way? And what do I need to do to make it work?
I’ve also tried this:
$data = mysql_query("
SELECT * FROM cellnames
") or die(mysql_error());
Which results in:
No database selected
Can this have something to do with it? I’ve already specified the database in the connection string but perhaps that didn’t work? This is my connection string:
$connectionInfo = array( "Database"=>"ranos_se");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
You should try with
sqlsrv_queryinstead ofmysql_query. As you are usingMSSQL, notMYSQL.like