How to set database connectivity in PHP?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Posted Mar 20, 2014, 5:10 AM EDT
Visit this link may help you
http://www.w3schools.com/Php/php_mysql_connect.asp
Please accept, if it helpful to you
KalaiRank #8,005 · 230 reputationPosted Mar 20, 2014, 5:55 AM EDT
//Servername , username , password
$connection = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$connection) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($connection);
?>