Hey man,
How was the mysql install compiled? If you compiled php5 without the necessary mysql support, your code will reveal nothing... Below is how I compiled php5:
./configure --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.29 --enable-track-vars
This builds with the advanced mysqli call to database as well as the old mysql call.
If you did infact include those statements in you build. What you could do is place || die (mysql_error()); at the end of your connection statement, to get more info..
$dbcnx = @mysql_connect('localhost', 'root', 'root') || die (mysql_error());
Chk your grant table privileges.. If you are connecting to the webserver and database from a remote machine and cannot connect, you probably need to add another user alias to the grant tables.. You need user@localhost and user@% . The later is the one you need if you are connecting from another workstation. Here are the commands in mysql..
mysql> GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost'
-> IDENTIFIED BY 'some_pass' ;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'user'@'%';
Chkout
http://dev.mysql.com/doc/mysql/en/Adding_users.html for more info.
One more thing.. It seems like your connect statement looks odd. I have never seen it that way with the @ before the mysql.. I connect using followning code.
@ $db = mysqli_connect(blah, blah, blah);
That could me messing you up, not sure though.. I am new to php and mysql..
One more thing, create alternate users and not 'root'..