php修正について
下記のPHPの'y_name'の並びをあ~昇順で表示したいのですが
どこを追加修正すればよいか教えてください。
<?php require_once('../../Connections/harada_drag_store.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_rs_kusuri = 20;
$pageNum_rs_kusuri = 0;
if (isset($_GET['pageNum_rs_kusuri'])) {
$pageNum_rs_kusuri = $_GET['pageNum_rs_kusuri'];
}
$startRow_rs_kusuri = $pageNum_rs_kusuri * $maxRows_rs_kusuri;
mysql_select_db($database_harada_drag_store, $harada_drag_store);
$query_rs_kusuri = "SELECT * FROM kusuri ORDER BY id DESC";
$query_limit_rs_kusuri = sprintf("%s LIMIT %d, %d", $query_rs_kusuri, $startRow_rs_kusuri, $maxRows_rs_kusuri);
$rs_kusuri = mysql_query($query_limit_rs_kusuri, $harada_drag_store) or die(mysql_error());
$row_rs_kusuri = mysql_fetch_assoc($rs_kusuri);
if (isset($_GET['totalRows_rs_kusuri'])) {
$totalRows_rs_kusuri = $_GET['totalRows_rs_kusuri'];
} else {
$all_rs_kusuri = mysql_query($query_rs_kusuri);
$totalRows_rs_kusuri = mysql_num_rows($all_rs_kusuri);
}
$totalPages_rs_kusuri = ceil($totalRows_rs_kusuri/$maxRows_rs_kusuri)-1;
$queryString_rs_kusuri = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_rs_kusuri") == false &&
stristr($param, "totalRows_rs_kusuri") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_rs_kusuri = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_rs_kusuri = sprintf("&totalRows_rs_kusuri=%d%s", $totalRows_rs_kusuri, $queryString_rs_kusuri);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
<title>お薬情報【全リスト】</title>
</head>
<body bgcolor="#006699" text="#333333" link="#0000CC" vlink="#0000CC" alink="#FF0000">
<table border="0" align="center" cellpadding="1" cellspacing="2">
<tr bgcolor="#CC6600">
<td height="25" colspan="10"><div align="center"><strong><font color="#FFFFFF" size="3">お薬情報 ≪リスト≫</font></strong></div></td>
</tr>
<tr>
<td colspan="10"><div align="center"><font color="#CCCCCC" size="2">登録ID順(降順)で表示しています。</font></div></td>
</tr>
<?php do { ?>
<tr bgcolor="#FFCC99">
<td><div align="right"><font size="2"><a href="kusuri_details.php?id=<?php echo $row_rs_kusuri['id']; ?>&pageNum_rs_kusuri=<?php echo ($pageNum_rs_kusuri); ?>"> <?php echo $row_rs_kusuri['id']; ?> </a></font></div></td>
<td align="center"><font size="2"><?php echo $row_rs_kusuri['date']; ?></font></td>
<td align="center"><font size="2">
<?php $value = $row_rs_kusuri['view']; switch ($value) { case "00": echo "×"; break; case "01": echo "○"; break; default: echo "-"; break; } ?>
</font></td>
<td align="center"><font size="2"><?php echo $row_rs_kusuri['date_open']; ?></font></td>
<td align="center"><font size="2"><?php echo $row_rs_kusuri['date_close']; ?></font></td>
<td align="center"><font size="2"><?php echo $row_rs_kusuri['name']; ?></font></td>
<td align="center"><font size="2"><?php echo $row_rs_kusuri['y_name']; ?></font></td>
<td align="center"><font size="2"><?php echo $row_rs_kusuri['y_seibun_name']; ?></font></td>
<td align="center"><font size="2"><?php echo $row_rs_kusuri['y_meker']; ?></font></td>
<td><font size="2"><?php echo $row_rs_kusuri['y_konou']; ?></font></td>
</tr>
<?php } while ($row_rs_kusuri = mysql_fetch_assoc($rs_kusuri)); ?>
</table>
<br>
<</table>
</body>
</html>
<?php
mysql_free_result($rs_kusuri);
?>
お礼
すみません... 大丈夫でした!! 有難うございます。
補足
やってみたけど...変化なしです