~jorge/charms/precise/lamp/readme-fixes

« back to all changes in this revision

Viewing changes to lib/opendb.php

  • Committer: Victor Palau
  • Date: 2012-09-03 16:48:29 UTC
  • Revision ID: vtuson@gmail.com-20120903164829-n5ob87ro845fzgzh
lamp charm

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
//read what mysql server to use
 
4
$configfile = "mysql";
 
5
$result=parse_ini_file($configfile);
 
6
 
 
7
//read mysql db information
 
8
$mysql_info=parse_ini_file($result['server_ip']);
 
9
 
 
10
//connect to db
 
11
 
 
12
mysql_connect($result['server_ip'],$mysql_info['server_user'],$mysql_info['server_pass']);
 
13
mysql_select_db($mysql_info['server_db']);
 
14
 
 
15
?>