Commit 89ecc548 by Vitalik

Support php 5.2

parent 5725cd7e
Pipeline #177 skipped
<?php
return array(
'server' => 'localhost',
'database' => 'dibi',
'table' => 'links',
'username' => 'root',
......
......@@ -6,7 +6,7 @@ function connect_db()
{
global $config;
$link = mysql_connect('localhost', $config['username'], $config['password']);
$link = mysql_connect($config['server'], $config['username'], $config['password']);
if (!$link) {
die('Could not connect: ' . mysql_error());
......
<?php
if( !defined( __DIR__ ) ) define( __DIR__, dirname(__FILE__) );
define('PATH_BASE', __DIR__);
require_once PATH_BASE . '/helper.php';
......
<?php
if( !defined( __DIR__ ) ) define( __DIR__, dirname(__FILE__) );
if (!file_exists(__DIR__ . '/config.php')) {
die("Copy `config.php.example` file to `config.php` file\n");
}
......@@ -7,7 +9,7 @@ if (!file_exists(__DIR__ . '/config.php')) {
$config = require __DIR__ . '/config.php';
$link = mysql_connect(
'localhost',
$config['server'],
$config['username'],
$config['password']
);
......@@ -43,4 +45,4 @@ if (mysql_query($sql, $link)) {
echo "Error creating table: " . mysql_error() . "\n";
}
mysql_close($link);
\ No newline at end of file
mysql_close($link);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment