connecting either as root or regular user, everything works fine from mysql console
on php, connects fine, set schema fine, but will not pull data from schema.
// connect and set schema
$_db = mysql_connect( '127.0.0.1', 'root', '*******' );
mysql_select_db( 'suangao' );
echo "schema = ".db_get_col("select database()");
// => schema = suangao
// non-table query
$result = mysql_query( "select 1" );
echo "rows 1 = ".mysql_num_rows($result);
// => rows 1 = 1
// simplest table query
$result = mysql_query( "select 1 from users" );
echo "rows 2 = ".mysql_num_rows($result);
// => rows 2 = 0
php does not even see users table, but in mysql created, inserted, etc
have same setup working fine on different machine, but cannot get this to fly
mea culpa! indeed the table users was empty! I had mistakenly believed that select 1 from table would always return 1 if the table existed - evidently I was incorrect!
usersisn't empty? In all other cases it have to work… EDIT: "through php does not even see users table" that again must have something to do with user rights in MySQL… - feeelausersexists and has rows - and when logged in through console have full access - only through php connection is access limited. - cc young