<?php
//$mysqli = new mysqli('localhost', 'root', '', 'vedanta');

//$host='localhost:3306'; // Host name
//$username='rcpindia_usr1'; // Mysql username
//$password='rcp@1234'; // Mysql password
$db_name="rcpindia_db"; // Database name
//$tbl_name='users'; // Table name 

//connection to the database
$link = mysql_connect('www.lipsonline.in:3306', 'rcpindia_usr', 'rcp@1234');
if (!$link) {
    die('Could not connect rcpindia_usr: ' . mysql_error());
}
echo 'Connected successfully rcpindia_usr: '; 

$db_list = mysql_list_dbs($link); 
while ($row = mysql_fetch_object($db_list)) {
echo $row->Database . "\n";
} 


//mysql_close($link);


// Connect to server and select databse.
// mysql_connect('$host', '$username', '$password')or die('cannot connect database');
//mysql_select_db('rcpindia_db')or die("cannot select DB");

mysql_select_db("rcpindia_db", $link) or die ("Unable to select database"); 


//execute the SQL query and return records
$result = mysql_query("SELECT * FROM users");
if(!($result)) die("Query DB did not work"); 
//fetch tha data from the database
while ($row = mysql_fetch_array($result)) {
   echo "ID:".$row{'id'}." Name:".$row{'username'}."
   ".$row{'password'}."<br>";
}



?>