I’d suggest losing the @ so you can actually see any errors. A catastrophic failure of the operation could return null instead of false – just another reason I’ve never been wild about the mySQL_ functions in the first place and bailed for PDO at the first opportunity.
“Undefined variable”, when you know you have defined the variable as in this case, probably points to the fact that the calling script cannot find it because of the way you have included the file containing the dependency.
To prove/disprove the above case temporarily hardcode the missing variable above your query.
I did what you suggested.
That is removed the @ from behind MySQL db connection.
And actually added language to show that DB connection is successful.
And all I get is response that the DB connections were successful.
Connected to dbcnx_ax OK
Connected to LocalHost dbcnx_nd OK
Notice: Undefined variable: dbcnx_nd in /var/www/html/dreamdates.com/new2/index.php on line 14
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/html/dreamdates.com/new2/index.php on line 14
This is really amazing
Really an unacceptable error message.
I mean the DB connection to $dbcnx_nd is made OK, yet it is saying that this Variable is undefined!
I did as you suggested.
That is I moved the DB connection code from the include file into the page that is making use of this DB connection, and yet it still gives same Error message!
Connected to $dbcn_anx DB OK
Connected to LocalHost $dbcnx_nd OK
Notice: Undefined variable: dbcnx_nd in /var/www/html/dreamdates.com/new2/index.php on line 29
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/html/dreamdates.com/new2/index.php on line 29