登录 | 注册 | FAQ
Anonymous

Permanent Connection to a database

+ 发表回复

4 篇帖子 分页: 1 / 1


Permanent Connection to a database

bmedia » 周日 5月 04, 2014 4:35 am

I don't know how this may sound but I am worried about it. Lets assume that I have finished using XAMPP to design and edit my website and I am ready to upload the site to the remote server and also export the database to the remote server.
I am pretty good at all this.
I also know that I should create a new user credentials for the database using PhpmyAdmin.

My question is how to I create a permanent connection to the database because as at now the site is live and data have to run between the frontend and the backend.

Do I have to create a new file called eg config.php and insert the database credentials in this file. I am worried because this is the first time I am creating a database all by myself.
I need your advice.
Thanks.
头像

bmedia

  • 帖子: 10
  • 注册: 周六 3月 29, 2014 7:56 am

Re: Permanent Connection to a database

XainPro » 周一 5月 05, 2014 7:44 am

You have answred all your question by your self

create a file config.php and insert the database credentials in this file and connection code
then include that file in every page you want any data drive from database by this you do not need to enter all your
credentials in lot's of places you need to learn about including a file in php

Check this command at online php manual

http://www.php.net/manual/en/function.include-once.php

You don't need Permanent Connection to a database.
头像

XainPro

  • 帖子: 3933
  • 注册: 周五 2月 17, 2012 8:10 pm

Re: Permanent Connection to a database

bmedia » 周二 5月 06, 2014 6:44 am

Which actually means that any page(s) which does not have php scripts should not have this link?
头像

bmedia

  • 帖子: 10
  • 注册: 周六 3月 29, 2014 7:56 am

Re: Permanent Connection to a database

XainPro » 周三 5月 07, 2014 8:38 am

YES
头像

XainPro

  • 帖子: 3933
  • 注册: 周五 2月 17, 2012 8:10 pm


+ 发表回复

分页: 1 / 1