I’m a newbie in php programming and I’d construct a php site with mysql db. Now I don’t know where often a web programmer insert db connection function in his web page.
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.
Separate the connection and the connectionsettings into e.g.
connect.inc.phpandconfig.inc.phpStore the settings in config.inc.php and call that file (
require_once()) from connect.inc.php. Then call connect.inc.php from the page you are working on (e.g. index.php)