In index.php I set a variable
$cn = @mysql_connect(............);
Then I include file.inc.php
include("file.inc.php");
In file.inc.php
if($cn==null) echo "Hello";
And print "Hello".
How can I do for use $cn in file.inc.php ???
Put the code in index.php and see what it does. It looks like your db connection isn't succeeding. Removing the "@" sign when developing code might help, too.