Maracles Posted May 25, 2009 Share Posted May 25, 2009 I am learning mysql at the comment and in the tutorial I am using I am taught to use the function (mysql_connect_errno()) to check for problems with the connection between page and database. This function however does not appear to be recognised, mysql_error is however. I cannot find any official documentation on (mysql_connect_errno()), am I missing something? Link to comment https://forums.phpfreaks.com/topic/159599-solved-mysql_connect_errno-not-recognised/ Share on other sites More sharing options...
mattal999 Posted May 25, 2009 Share Posted May 25, 2009 Google helped here There is no mysql_connect_errno function. what you need is mysql_errno(). http://us2.php.net/manual/en/function.mysql-errno.php Link to comment https://forums.phpfreaks.com/topic/159599-solved-mysql_connect_errno-not-recognised/#findComment-841789 Share on other sites More sharing options...
Maracles Posted May 25, 2009 Author Share Posted May 25, 2009 Sorry, I noticed a typo in my above post. The function you found on Google is actually tthe function which I am using now (which I did find in Google!). However in the book, and the test source code that came on the accompanying CD, it actually uses (mysqli_connect_errno()), this is why I was getting confused? Is the book therefore mistaken? Link to comment https://forums.phpfreaks.com/topic/159599-solved-mysql_connect_errno-not-recognised/#findComment-841790 Share on other sites More sharing options...
mattal999 Posted May 25, 2009 Share Posted May 25, 2009 It could just be a user defined function to do some custom error checking. Have a look back through the book to see if it is defined at any time. EDIT: Does the book use mysqli_connect_errno? Link to comment https://forums.phpfreaks.com/topic/159599-solved-mysql_connect_errno-not-recognised/#findComment-841794 Share on other sites More sharing options...
PFMaBiSmAd Posted May 25, 2009 Share Posted May 25, 2009 mysqli_connect_error is part of the mysqli extension. Link to comment https://forums.phpfreaks.com/topic/159599-solved-mysql_connect_errno-not-recognised/#findComment-841798 Share on other sites More sharing options...
Maracles Posted May 25, 2009 Author Share Posted May 25, 2009 Thank you for that. That kind of makes more sense, the book refers to object-orientated and procedural code and attempts to push the object orientated approach which I find slightly more difficult to grasp. I think me trying to use one and the book teach the other is a little confusing for me! Link to comment https://forums.phpfreaks.com/topic/159599-solved-mysql_connect_errno-not-recognised/#findComment-841801 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.