|
 |
|
พี่ๆครับช่วยผมดูดาต้าเบสแบบนี้ทีนะครับ ผมไม่รู้จะเก็บมันยังไงอะครับ |
|
 |
|
|
 |
 |
|
Table : Sections
section_id
section_detail
Table : Notices
notic_id
section_id
notic_detail
แค่นี้พอมองออกไหม
|
 |
 |
 |
 |
Date :
2011-05-15 22:37:00 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เราต้องสร้างมาสอง table หรอครับ ขอบคุณนะครับ
|
 |
 |
 |
 |
Date :
2011-05-15 22:38:59 |
By :
catzaa |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จริงๆ จะสร้างเทเบิลเดียวก็ได้ นะใช้เทคนิคนิดหน่อย แต่มันจะไม่ได้คอนเซปของดีบีเท่าไหร่ แต่ใช้ได้เหมือนกัน
|
 |
 |
 |
 |
Date :
2011-05-15 23:08:20 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตามนั้นครับ อ้อ....ผมชอบคำว่า "คอนเซปของดีบี" ของพี่อั๋นครับ 
|
 |
 |
 |
 |
Date :
2011-05-15 23:29:11 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com JavaScript Add/Remove Element</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<script language="javascript">
function CreateNewRow()
{
var intLine = parseInt(document.frmMain.hdnMaxLine.value);
intLine++;
var theTable = document.all.tbExp
var newRow = theTable.insertRow(theTable.rows.length)
newRow.id = newRow.uniqueID
var item1 = 1
var newCell
//*** ข้อที่ ***//
newCell = newRow.insertCell(0)
newCell.id = newCell.uniqueID
newCell.setAttribute("className", "css-name");
newCell.innerHTML = "<INPUT TYPE=\"TEXT\" SIZE=\"3\" NAME=\"Column1_"+intLine+"\" VALUE=\"\">"
//*** ข้อกำหนด ***//
newCell = newRow.insertCell(1)
newCell.id = newCell.uniqueID
newCell.setAttribute("className", "css-name");
newCell.innerHTML = "<INPUT TYPE=\"TEXT\" SIZE=\"70\" NAME=\"Column2_"+intLine+"\" VALUE=\"\">"
document.frmMain.hdnMaxLine.value = intLine;
}
function RemoveRow()
{
intLine = parseInt(document.frmMain.hdnMaxLine.value);
if(parseInt(intLine) > 0)
{
theTable = (document.all) ? document.all.tbExp :
document.getElementById("tbExp")
theTableBody = theTable.tBodies[0];
theTableBody.deleteRow(intLine);
intLine--;
document.frmMain.hdnMaxLine.value = intLine;
}
}
</script>
<body>
<form name="frmMain" action="test3.php"method="post">
<table width="50%" border="1" cellspacing="0" cellpadding="0">
<tr>
<th width="22%" scope="row">มาตราที่:
<input name="txtID" type="text" value="" size="9">
</th>
<td width="78%">รายละเอียด
<input name="txtDetail" type="text" size="60"></td>
</tr>
<tr>
<th scope="row"> </th>
<td><div ><table width="445" border="1" id="tbExp">
<tr>
<td width="89"><div align="center">ข้อที่</div></td>
<td width="340"><div align="center">ข้อกำหนด </div></td>
</tr>
</table>
<input type="hidden" name="hdnMaxLine" value="0">
<input name="btnAdd" type="button" id="btnAdd" value="+" onClick="CreateNewRow();">
<input name="btnDel" type="button" id="btnDel" value="-" onClick="RemoveRow();">
</div></td>
</tr>
</table>
<input type="hidden" name="line" value="intLine">
<input name="sub" type="submit" value="submit">
</form>
<?php
$intLine="<script>document.write(intLine)</script>";
echo $intLine;
?>
</body>
</html>
พี่ครับผมไปต่อไม่ได้จริงๆครับ ช่วยผมเอามันลงฐานข้อมูลหน่อยนะครับพี่ๆครับ
|
 |
 |
 |
 |
Date :
2011-05-15 23:57:19 |
By :
catzaa |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
test3.php เขียนยังไง
|
 |
 |
 |
 |
Date :
2011-05-16 00:13:16 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ออ ครับพอดีเพือนผมมาช่วยแก้ว่า จะลองให้มันส่งค่าออกมาดูเฉยๆครับแต่ก็พากันไปต่อไม่ได้เลยได้แค่หน้านี้อะครับ เหอๆ พี่ช่วยด้วยนะครับผมไปไม่เป็นแล้ว
|
 |
 |
 |
 |
Date :
2011-05-16 00:22:03 |
By :
catzaa |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|