Escolar Documentos
Profissional Documentos
Cultura Documentos
<?php
//open connection to mysql db
$hostname = 'localhost';
$username = 'root';
$password = '';
$dbname = 'dbloanmanagerv3';
$conn = @mysql_connect($hostname,$username,$password);
if (!$conn) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db($dbname, $conn);
//filter
$id = intval($_REQUEST['id']);
//$id = 359;
$where = "contact_id=$id";
//create an array
$items = array();
while($row = mysql_fetch_object($rs)){
//array_push($items, $row);
$items[] = $row;
}
//save jason data to file - optional- for viewing of json file only
//$json_data = json_encode($items);
//file_put_contents('sample_php_to_json1.json', $json_data);
?>