PHP Classes

File: start_connect.inc.php

Recommend this page to a friend!
  Classes of Narong   DS Create table   start_connect.inc.php   Download  
File: start_connect.inc.php
Role: Auxiliary script
Content type: text/plain
Description: connection to database
Class: DS Create table
Display an HTML table with data from an array
Author: By
Last change: Error report
Date: 14 years ago
Size: 824 bytes
 

Contents

Class file image 10411 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

?>