06-02-2011, 01:31 PM
|
#11 (permalink)
|
|
The Wanderer
Join Date: May 2011
Posts: 9
Thanks: 0
|
i do like this for insert
im trying using update but dosent work and is insert to diffrent order not in the same
i make my primary key auto increment
<?php
include("config.php");
$ORDERING_DEPT = $_POST['ORDERING_DEPT']== mysql_real_escape_string($_POST['ORDERING_DEPT']);
$result = mysql_query("select ORDER_DESC from orders where ORDER_DESC='CSF' '%CSF%' AND ORDER_DESC LIKE '%LFT%' ");
$sql = "INSERT INTO orders (ORDERING_DEPT) VALUES ('$ORDERING_DEPT')";
mysql_query($sql) or die(mysql_error());
mysql_close($con)
?>
for my shown data :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<title>Untitled Document</title>
</head>
<body>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("project", $con);
$result = mysql_query("SELECT * FROM orders");
echo "<table class='table' >
<tr>
<th class='th'>order_no</th>
<th class='th'>ORDER_TYPE</th>
<th class='th'>ORDER_DESC</th>
<th class='th'>ORDERING_DEPT </th>
<th class='th'>ORDERING_SERVICE</th>
<th class='th'>SENDING_DATE</th>
<th class='th'>DELIVERING_NO</th>
<th class='th'>DELIVERING_DEPT </th>
<th class='th'>DELIVERING_DATE</th>
<th class='th'>PRODECT_CODE </th>
<th class='th'>ORDER_DOSES </th>
<th class='th'>PROFILE_CODE </th>
<th class='th'>LAB_RESULT</th>
<th class='th'>LOW_END</th>
<th class='th'>HIGH_END </th>
<th class='th'>IMAG_CODE </th>
<th class='th'>RADIOLOGY_RESULT </th>
<th class='th'>VERIFY_NO</th>
<th class='th'>STATUS</th>
<th class='th'>URGENCY_CODE </th>
<th class='th'>MEASUREMENT_UNIT </th>
<th class='th'>MEDICINE_ROUTE</th>
<th class='th'>COMMENT </th>
<th class='th'>staff_id</th>
<th class='th'>pat_id </th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td class='td' >" . $row['order_no'] . "</td>";
echo "<td class='td' >" . $row['ORDER_TYPE'] . "</td>";
echo "<td class='td' >" . $row['ORDER_DESC'] . "</td>";
echo "<td class='td' >" . $row['ORDERING_DEPT'] . "</td>";
echo "<td class='td' >" . $row['ORDERING_SERVICE'] . "</td>";
echo "<td class='td' >" . $row['SENDING_DATE'] . "</td>";
echo "<td class='td' >" . $row['DELIVERING_NO'] . "</td>";
echo "<td class='td' >" . $row['DELIVERING_DEPT'] . "</td>";
echo "<td class='td' >" . $row['DELIVERING_DATE'] . "</td>";
echo "<td class='td' >" . $row['PRODECT_CODE'] . "</td>";
echo "<td class='td' >" . $row['ORDER_DOSES'] . "</td>";
echo "<td class='td' >" . $row['PROFILE_CODE'] . "</td>";
echo "<td class='td' >" . $row['LAB_RESULT'] . "</td>";
echo "<td class='td' >" . $row['LOW_END'] . "</td>";
echo "<td class='td' >" . $row['HIGH_END'] . "</td>";
echo "<td class='td' >" . $row['IMAG_CODE'] . "</td>";
echo "<td class='td' >" . $row['RADIOLOGY_RESULT'] . "</td>";
echo "<td class='td' >" . $row['VERIFY_NO'] . "</td>";
echo "<td class='td' >" . $row['STATUS'] . "</td>";
echo "<td class='td' >" . $row['URGENCY_CODE'] . "</td>";
echo "<td class='td' >" . $row['MEASUREMENT_UNIT'] . "</td>";
echo "<td class='td' >" . $row['MEDICINE_ROUTE'] . "</td>";
echo "<td class='td' >" . $row['COMMENT'] . "</td>";
echo "<td class='td' >" . $row['staff_id'] . "</td>";
echo "<td class='td' >" . $row['pat_id'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
</body>
</html>
|
|
|
|