update ไม่ได้ <? $host="localhost"; $username=""; $passwo
<?
$host="localhost";
$username="";
$password="";
$db="blood";
$tb="booking";
mysql_connect( $host,$username,$password) or die ("?????????????????? Mysql ?????? ");
mysql_select_db($db) or die("????????????????????"); /* ??????????????????????? */
$sql="Select med_id,blood,Rh,type,date_use,date,HN,ward,id_blood From $tb where id_blood=''";
$db_query=mysql_db_query($db,$sql);
$num_rows=mysql_num_rows($db_query); /* ??? Reccord ????? */
?>
<form method="post" action="checkblood.php" >
<table width="91%" border="1" align="center" bordercolor="#003366">
<tr bordercolor="#0033CC" bgcolor="#0099FF">
<td width="9%">
<div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">?????????</font></div>
</td>
<td width="8%">
<div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">??????????</font></div>
</td>
<td width="6%">
<div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">Rh</font></div>
</td>
<td width="8%">
<div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">??????</font></div>
</td>
<td width="10%">
<div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">?????????</font></div>
</td>
<td width="10%">
<div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">????????</font></div>
</td>
<td width="10%">
<div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">HN</font></div>
</td>
<td width="13%">
<div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">ward</font></div>
</td>
<td width="35%">
<div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">?????????</font></div>
</td>
</tr>
</table>
<?
$a=0;
while($a < $num_rows)
{
$result = mysql_fetch_array($db_query);
$med_id=$result[med_id];
$blood=$result[blood];
$Rh=$result[Rh];
$type=$result[type];
$date_use=$result[date_use];
$date=$result[date];
$HN=$result[HN];
$ward=$result[ward];
$id_blood=$result[id_blood];
?>
<table width="91%" border="1" align="center">
<tr>
<td width="9%"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<div align="center"><?echo"$med_id";?><input type="hidden" name="med_id" value="<? echo"$med_id"; ?>">
</div>
</font> </td>
<td width="8%"> <font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<div align="center">
<?echo"$blood";?>
<input type="hidden" name="blood" value="<? echo"$blood"; ?>">
</div>
</font> </td>
<td width="6%"> <div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<?echo"$Rh";?>
<input type="hidden" name="Rh" value="<? echo"$Rh"; ?>">
</font></div></td>
<td width="8%">
<div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<?echo"$type";?>
<input type="hidden" name="type" value="<? echo"$type"; ?>">
</font></div></td>
<td width="10%"> <div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<?echo"$date_use";?>
<input type="hidden" name="date_use" value="<? echo"$date_use"; ?>">
</font></div></td>
<td width="10%"> <div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<?echo"$date";?>
<input type="hidden" name="date" value="<? echo"$date"; ?>">
</font></div></td>
<td width="10%"> <div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<?echo"$HN";?>
<input type="hidden" name="HN" value="<? echo"$HN"; ?>">
</font></div></td>
<td width="13%"> <div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<?echo"$ward";?>
<input type="hidden" name="ward" value="<? echo"$ward"; ?>">
</font></div></td>
<td width="35%"> <div align="center">
<input type="text" name="id_blood" size="10" maxlength="10">
<input type="submit" name="Submit" value="update">
</div></td>
</tr>
</table>
<?
$a++;
}
echo"<center><br>????? Reccord = $num_rows</center>";
?>
</form>
----------------------------------------------------------
<?
$host="localhost";
$username="";
$password="";
$db="blood";
$tb="booking";
$connect= mysql_connect( $host,$username,$password) or die ("no ");
mysql_select_db($db) or die("no no");
$sql="update $tb set med_id='$med_id',blood='$blood',Rh='$Rh',type='$type',unit='$unit',date_use='$date_use',date='date',HN='$HN',ward='$ward',id_blood='$id_blood' where med_id=$med_id";
$db_query=mysql_db_query($db,$sql);
echo "<font face=AngsanaUPC size=5 color=red>ready</font>";
mysql_close();
?>Tag : - - - -
Date :
29 Feb 2547 18:43:24
By :
kae330
View :
3314
Reply :
1
$sql="Select med_id,blood,Rh,type,date_use,date,HN,ward,id_blood From $tb where id_blood=''";
ไม่มีค่า where ครับ where id_blood
Date :
2 Mar 2547 15:25:38
By :
webmaster
Load balance : Server 04