Hi,

How do i prevent printing "Warning" bit of connection error? I only want see my error message on screen.

Note: I deliberetly enter wrong Host IP to see the message thou.

Warning: mysql_connect() [function.mysql-connect]: Host '127.0.0.123123' is not allowed to connect to this MySQL server in C:\apache\login\database.php on line 3
ERROR: Server connection error;
$conn = mysql_connect(self::DBSRV, self::DBUID, self::DBPSW);
if(!$conn){
die("ERROR: Server connection error;");
}

Thanks

Just got a message from different forum and solved. I didn't know it could be this simple.

Put @ before 'mysql_connect'
@mysql_connect

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.