sc0tt Posted January 28, 2009 Share Posted January 28, 2009 Hello, I made a call to a php script via ajax in my code . The php script tests for connection to a MYSQL database . If connection is successful , it echos "Connection Succeeded", and that correctly shows up in the responseText property. However, if the connection fails , i have echoed "Connection failed" . Now , the strange thing is that if the connection fails, the warning from mysql , which is as below, also gets appended to the text i have echoed. Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host .... Connection failed How, can i prevent the warning from the mysql server from automatically getting appended to the responseText ? Thank You. Quote Link to comment Share on other sites More sharing options...
nareshrevoori Posted January 28, 2009 Share Posted January 28, 2009 Put error suppression operator(@) in front of your mysql_connect function. just like this @mysql_connect("HOST","USERNAME","PASSWORD"); so basically what @ operator does is it will suppress the error handling mechanism by PHP. Quote Link to comment Share on other sites More sharing options...
sc0tt Posted January 28, 2009 Author Share Posted January 28, 2009 Thanks a lot naresh..that worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.