CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 mysql connection error message

Print topic Send  topic

Author Message
thomas2340

Posts: 55
Posted: 10/17/2004, 3:10 AM

how can i get the mysql connection status, i need a event to check if there is a mysql connection error, so that i can echo my own errotext #dberror# for example.

thanx thomas2340
View profile  Send private message
hidran

Posts: 29
Posted: 10/20/2004, 5:03 AM

$DBconnectionname->Connected
View profile  Send private message
feha


Posts: 712
Posted: 10/25/2004, 5:45 PM

<?  
//by feha at www.vision.to  
ini_set('display_errors', '0');  
$link = mysql_connect("localhost", "user", "pass");  
if (mysql_errno() == 1040 OR mysql_errno() == 1203) {  
    define("DB_HOST", "some_ip:3306");//remote  
    define("DB_NAME", "db");  //database_name  
    define("DB_USER", "user"); //database user name  
    define("DB_PASSWORD","pass");  //database (user) password  
}  
else  
{  
    define("DB_HOST", "localhost");  
    define("DB_NAME", "db_name2");  //database_name  
    define("DB_USER", "user"); //database user name  
    define("DB_PASSWORD","pass");  //database (user) password  
}  
ini_set('display_errors', '1');  
  
?> 

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.