|
 |
|
ช่วยด้วย ครับ ดึง Menu Tree จาก PHP แล้วแต่ ห้วข้อมัน แยกออกตาม SUB MENU หมดเลยนะครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?php
$servername = "mssql2008r2xxx"; //?ชื่อ? server
$databasename = "xxxx"; //?ชื่อ? database ?บน? MsSQL
$user = "xxxxx"; //?username ?ที่?จะ? connect database
$pass = "xxxxx"; //?password ?ที่?จะ? connect ?ไปที่? database
$connection_string ="DRIVER={SQL Server};SERVER=$servername;DATABASE=$databasename;AutoTranslate=no"; //?connect แบบ ODBC
$cid = odbc_connect($connection_string,$user, $pass) or die ("?เชื่อม?ต่อ server ไม่?ได้?");
$cInvCCode = $_REQUEST['cInvCCode'];
$strSQL = "SELECT * FROM InventoryClass
WHERE iInvCGrade = '3'
AND cInvCCode LIKE 'AB%'";
$objExec = odbc_exec($cid, $strSQL) or die ("Error Execute [".$strSQL."]");
$objResult = odbc_fetch_array($objExec);
while($objResult = odbc_fetch_array($objExec))
{
echo"<div class=\"accordion\"><h3>$objResult[cInvCName]</h3> ";
$strSQL2 = "SELECT * FROM pd_inv a WHERE a.pd_cod LIKE '$objResult[cInvCCode]%'";
$objExec2 = odbc_exec($cid, $strSQL2) or die ("Error Execute [".$strSQL2."]");
while($result = odbc_fetch_array($objExec2))
{
?>
<p><?=$result["pd_nambill"];?></p>
<?
}
echo "</div>";
}
?>
</body>
<?
odbc_close($cid);
?>
|
 |
 |
 |
 |
Date :
2012-01-06 16:50:45 |
By :
kongit7 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|