Database Connection

Top  Previous  Next

 

What's a database connection, and how is it different from my database?

A database connection is a very important concept.  dbQwikSite and your pages must "connect" to your database in order to read and write records.  It's much like a telephone, your pages must "call" your database which will accept the call and then they can have a dialog using that connection.  So the connection is very much like a phone number.  A phone number is a definition of how to reach someone, it contains information about country codes, area codes, exchanges, and parts that are unique to the number you are calling.  When you store a telephone number in your phone you are creating a connection definition.  So if you store your father's number in your phone you don't need to remember his number any more...  you just have to call "Dad".  If "Dad" changes his number, you simply update the phone number and you keep calling "Dad".

 

Computers use this same technique of storing connection information under a listing (Dad).  This way programs, in our case, web pages, can be written simply to call "Dad" they don't need to know his number, we store the number in a "connection" definition, just like storing in your phone's memory.  This way you never have to change the programming, you only have to change the connection number.

 

It is this connection that we use in your web pages, this is how they can run on your computer using one database and on your host using another database.  As long as the databases are compatible, then the code will work fine.  When you use the deploy function in dbQwikSite, you have to enter new connection information for your server database so that your web pages can connect to that database instead of a database on your PC.  If you do not enter the correct connection information for your server, your pages will not be able to run.  The exact connection information to connect to your server database is usually supplied by your hosting company.