When one retrieves a database $link with mysql_connect(), how can one check if that link is still valid after some time? (I am not asking whether the returned is valid, I mean later)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
mysql_ping()ormysqli_ping()for this. However, in a regular web application you should just execute your queries and abort with an error if a query failed (or retry once).