<?php
include_once("function/DatabaseSetting.php");
function readAllProduct()
{
$con = mysql_pconnect(DB_SERVER,DB_USERNAME,DB_PASSWORD);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db(DB_DATABASE_NAME, $con);
$result = mysql_query("
SELECT * FROM medical m
JOIN type t ON m.type_id=t.type_id
JOIN unit u ON m.unit_id=u.unit_id
");
$products = array();
while ($row = mysql_fetch_array($result))
{
array_push($products, $row);
}
mysql_close($con);
return $products;
}
?>