andyd34 Posted March 7, 2010 Share Posted March 7, 2010 I am trying to check if a given set of vaiables connects or fails to connect to a mysql database without triggering an error because I want to create my own error messages. The reason for this is the connection is being tested in jquery so the form will be submitted without page refresh and if the error reporting is on it just looks like you click a button for nothing can anybody help Link to comment https://forums.phpfreaks.com/topic/194420-php-mysql-without-error-reporting/ Share on other sites More sharing options...
wwfc_barmy_army Posted March 7, 2010 Share Posted March 7, 2010 If I've understood what you want correctly then this should help: https://addons.mozilla.org/en-US/firefox/addon/1843 Link to comment https://forums.phpfreaks.com/topic/194420-php-mysql-without-error-reporting/#findComment-1022683 Share on other sites More sharing options...
andyd34 Posted March 7, 2010 Author Share Posted March 7, 2010 I think I may have made my question a bit vague I am creating an install script and want to check if the information entered is correct for instance mysql name mysql host mysql user mysql password if i use if(mysql_connect(host, user, password) { // do something } else { // do something else } Its just trigerring the inbuilt error which jquery doesnt recognise for some reason, I want to trigger my own response ie, true or false so I can then pass it client side Thanks anyway Link to comment https://forums.phpfreaks.com/topic/194420-php-mysql-without-error-reporting/#findComment-1022685 Share on other sites More sharing options...
gamblor01 Posted March 7, 2010 Share Posted March 7, 2010 I think you just need to use the die function. You don't need an if statement...try this in PHP and see if it does what you want: mysql_connect("$host", "$username", "$password")or die("any message you want goes here"); Link to comment https://forums.phpfreaks.com/topic/194420-php-mysql-without-error-reporting/#findComment-1022707 Share on other sites More sharing options...
andyd34 Posted March 7, 2010 Author Share Posted March 7, 2010 tried it but it wouldn't work with jquery. o well I'll have to try another way. Thanks anyway Link to comment https://forums.phpfreaks.com/topic/194420-php-mysql-without-error-reporting/#findComment-1022710 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.