View: database connect

  1. 10 years ago by sm0k1nggnu
    1. include "/inc/config.php";
    2. error_reporting(E_ALL ^ E_NOTICE);
    3.  
    4. $sql ="INSERT INTO dvd
    5.                      (column_name1,column_name2)
    6.           VALUES
    7.                      ('$value1','$value2')";
    8.  
    9.         $result = mysql_query($sql) OR die(mysql_error());
    10.         print_r($sql);
    11.  
    12.  
    13. #############################################
    14. ################config.php####################
    15.  
    16.     error_reporting(E_ALL);
    17.  
    18.     define('MYSQL_HOST',     'localhost');
    19.     define('MYSQL_USER',     'username');
    20.     define('MYSQL_PASS',     'password');
    21.     define('MYSQL_DATABASE', 'database_name');
    22.     $db_link = mysql_connect(MYSQL_HOST, MYSQL_USER,MYSQL_PASS);
    23.    $db = mysql_select_db("database_name");
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1276"></script>

0 comment about "database connect"