PHP Classes
elePHPant
Icontem

File: start_connect.inc.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Narong  >  DS Pager  >  start_connect.inc.php  >  Download  
File: start_connect.inc.php
Role: Auxiliary script
Content type: text/plain
Description: connection to database
Class: DS Pager
Show links to browse listings split in pages
Author: By
Last change: Error report
Date: 5 years ago
Size: 824 bytes
 

Contents

Class file image Download
<?php
   
/**
    * Configuration connect to server
    * Connect to localhost
    * Set server name
    * Set database name
    * Set user name
    * Set user password
    */
   
$serv_name = "localhost"; # <-- Your localhost
   
$dbas_name = ""; # <-- Your database name
   
$user_name = ""; # <-- Your user name
   
$user_pass = ""; # <-- Your user password
   
   
$conn = @mysql_connect($serv_name, $user_name, $user_pass) or die
                    (
"ERROR : Can't connect to server!!!<br /> Mysql report : ".mysql_error()); # <-- Create connection
   
@mysql_select_db($dbas_name, $conn) or die
                    (
"ERROR: Can't select database!!!<br /> Mysql report : ".mysql_error()); # <-- Select database
   
@mysql_query("SET NAMES UTF8") or die
                    (
"ERROR : Can't set endcoding!!!<br /> Mysql report : ".mysql_error()); # <-- Set database encoding

?>