<?php
$mysqlDatabaseName = "192.168.1.***";
$mysqlUsername = "****";
$mysqlPassword = "****";
mysql_connect($mysqlDatabaseName, $mysqlUsername, $mysqlPassword) or die(mysql_error());
mysql_select_db("Inventory") or die(mysql_error());
if(isset($_GET['action'])){
$action = $_GET['action'];
}
if($action == "fetch"){
$fetchKey = $_GET['ID'];
$result = mysql_query("SELECT nomenclature,location, part_number, date_inventoried,quantity,location_detail FROM tblInventory WHERE tblInventory.key = '$fetchKey'" ) or die(mysql_error());
$rows = array();
while($row = mysql_fetch_array($result)){
$rows[] = $row ['nomenclature'];
$rows[] = $row ['location'];
$rows[] = $row ['part_number'];
$rows[] = $row ['date_inventoried'];
$rows[] = $row ['quantity'];
$rows[] = $row ['location_detail'];
}
echo json_encode($rows);
}
?>