About us Privacy Disclaimer Contact us
FAQ Help Advertising Feedback
Home Sitemap Search Donate us

  Home > Computer & I'net > Include...

   Browse by title articles:
   What is hot:

Include

INSERT

SELECT

WHERE

Usability and Cost Savings while Designing an Intranet
Working With Graphics For The Web
CD-ROM Problems
Include
Prev articles1 2 



Include


Computer & I'net articlesInclude

by David Stanley    



Before getting any further into database coding, it will be good practice to call upon the PHP command of include.

The first part of server connection, database selection, and table selection is a repeated snippit, so to save time and effort, we'll put that part into a seperate file and just call it into play when we need it.

db_connect.inc
<?php

// set your infomation.
$dbhost='localhost';
$dbusername='david';
$dbuserpass='mypassword';
$dbname='test';

// connect to the mysql database server.
$link_id = mysql_connect ($dbhost, $dbusername, $dbuserpass);

// select the specific database name we want to access.
$dbname=$dbusername."_".$dbname;
if (!mysql_select_db($dbname)) die(sql_error());

?>

The PHP command to call that section of code into action :
include ("db_connect.inc");



-----------------
Article by David Stanley. Visit his site http://www.htmlite.com. Reprinted with permission.




Articles

Auto & Trucks

Business

Computer & I'net

  ·General

  ·Apache

  ·CSS

  ·Database

  ·Hardware

  ·HTML

  ·Javascript&DHTML

  ·Linux

MySQL

  ·Operating System

  ·Perl / CGI

  ·PHP

  ·Programming

  ·Publishing

  ·Search Engines

  ·Software Problems

  ·SSI

  ·Tips & Tricks

  ·Utilities

  ·Web Design

Family

Food & Drink

Gardening

Health

Other

Pets

Psychology

Spiritual

Travel

Women

 Calculators

Borrowing power




  Disclaimer | Privacy | Terms of useCopyright © 2004 Nice2know.com