I am learning MYSQL. I have copied this code from a learning website.
The original code was
<?php
$conn = @mysql_connect('115.0.0.1','root','root');
if (!$conn) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('mydb', $conn);
?>
I have modified the following localhost address, username, password and dbname as below code. Actually I am using Appserv as a server.
My Current Code admin is my username admin is my password 115.240.6.251 is my localhost address users is my dbname
this is code where i am getting the users
<?php
include 'conn.php';
$rs = mysql_query('select * from users');
$result = array();
while($row = mysql_fetch_object($rs)){
array_push($result, $row);
}
echo json_encode($result);
?>
the above details i am using for appserv
after changed the original code when run the this application i am not getting any row from db
when i checked in sql i have rows for the given table.
Please guide me here.
Thanks in advance Karthic