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? Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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! 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.