|
|
|
สอบถามครับ เรื่องการจัดข้อความในตาราง ให้ขึ้นบรรทัดใหม่เอง |
|
|
|
|
|
|
|
Code (PHP)
echo nl2br($_POST["txtDescription"]);
|
|
|
|
|
Date :
2011-05-13 11:50:45 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ถ้าcodeเป็นงี้อ่ะครับ จะใส่ไว้ตรงไหนเหรอครับCode (PHP)
<html>
<head>
<title></title></title>
</head>
<body bgcolor="#FFFFCC">
<meta http-equiv=Content-Type content="text/html; charset=utf-8"> <!????????????????>
<?php
mysql_connect("localhost","root","buddy123");
mysql_select_db("buddy");
mysql_query("SET NAMES UTF8"); //????????????????
list($date,$name)=split("[/]",$dateedit);
$strSQL = "SELECT * FROM time order by date";
$objQuery = mysql_query($strSQL);
?> <br><br>
<table width="3000" border="1" bgcolor="white" style="table-layout:fixed">
<tr bgcolor="#FF8040">
<th width="100"> <div align="center">Date</div></th>
<th width="100"> <div align="center">Name </div></th>
<th width="200"> <div align="center">8.30 </div></th>
<th width="200"> <div align="center">9.00 </div></th>
<th width="200"> <div align="center">9.30 </div></th>
<th width="200"> <div align="center">10.00 </div></th>
<th width="200"> <div align="center">10.30 </div></th>
<th width="200"> <div align="center">11.00 </div></th>
<th width="200"> <div align="center">11.30 </div></th>
<th width="200"> <div align="center">12.00 </div></th>
<th width="200"> <div align="center">12.30 </div></th>
<th width="200"> <div align="center">13.00 </div></th>
<th width="200"> <div align="center">13.30 </div></th>
<th width="200"> <div align="center">14.00 </div></th>
<th width="200"> <div align="center">14.30 </div></th>
<th width="200"> <div align="center">15.00 </div></th>
<th width="200"> <div align="center">15.30 </div></th>
<th width="200"> <div align="center">16.00 </div></th>
<th width="200"> <div align="center">16.30 </div></th>
<th width="200"> <div align="center">17.00 </div></th>
<th width="200"> <div align="center">17.30 </div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
if(($objResult[date]==$date)&& ($objResult[name]==$name))
{
?>
<tr>
<td height="100"><div align="center"><?=$objResult["date"];?></div></td>
<td height="100" onclick="window.location='editname.php?name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["name"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t830&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t830"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t900&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t900"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t930&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t930"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1000&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1000"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1030&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1030"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1100&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1100"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1130&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1130"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1200&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1200"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1230&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1230"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1300&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1300"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1330&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1330"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1400&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1400"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1430&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1430"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1500&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1500"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1530&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>" style="cursor:pointer;"><div align="center"><?=$objResult["t1530"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1600&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1600"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1630&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1630"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1700&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1700"];?></div></td>
<td height="100" onclick="window.location='edit.php?time=t1730&name=<?=$objResult["name"];?>&date=<?=$objResult["date"];?>';" style="cursor:pointer;"><div align="center"><?=$objResult["t1730"];?></div></td>
</tr>
<? }
}
?>
</table>
<?
mysql_close();
?>
</body>
</html>
|
|
|
|
|
Date :
2011-05-19 16:24:06 |
By :
naenapat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|