Zaloguj | Zarejestruj | FAQ
Anonymous

Permanent Connection to a database

+ Odpowiedz

Posty: 4 Strona 1 z 1


Permanent Connection to a database

przez bmedia » N maja 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.
Avatar użytkownika

bmedia

  • Posty: 10
  • Dołączył(a): So mar 29, 2014 7:56 am

Re: Permanent Connection to a database

przez XainPro » Pn maja 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.
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm

Re: Permanent Connection to a database

przez bmedia » Wt maja 06, 2014 6:44 am

Which actually means that any page(s) which does not have php scripts should not have this link?
Avatar użytkownika

bmedia

  • Posty: 10
  • Dołączył(a): So mar 29, 2014 7:56 am

Re: Permanent Connection to a database

przez XainPro » Śr maja 07, 2014 8:38 am

YES
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm


+ Odpowiedz

Strona 1 z 1