|
|
|
รบกวนสอบถามเรื่อง แสดงข้อมูล ถ้าไม่พบ id ให้แสดงผลว่าไม่พบข้อมูล |
|
|
|
|
|
|
|
Code (PHP)
<?php
include_once "../../includes/functionLib.php";
//
$id = $_GET["id"];
//$id = 6;
$SQL = "select * from crm_company_info where companyID = '".$id."' ;";//ecit omm by companyID
$result = $db->Execute($SQL);
$rows = $result->recordCount();//จำนวน row ว่ามีเท่าไหร่
if($rows>0){
$ARR = $result->FetchRow();
}
$smarty->assign("companyCode",$ARR["companyCode"]);
$smarty->assign("companyNameTH",$ARR["companyNameTH"]);
$smarty->assign("companyNameENG",$ARR["companyNameENG"]);
$smarty->assign("companyAddrNo",$ARR["companyAddrNo"]);
$smarty->assign("comapnyAddrBuild",$ARR["comapnyAddrBuild"]);
$smarty->assign("companyAddrFloor",$ARR["companyAddrFloor"]);
$smarty->assign("companyAddSoi",$ARR["companyAddSoi"]);
$smarty->assign("companyAddrRoad",$ARR["companyAddrRoad"]);
$smarty->assign("companySubDist",$ARR["companySubDist"]);
$smarty->assign("companyDistrict",$ARR["companyDistrict"]);
$smarty->assign("companyProvince",$ARR["companyProvince"]);
$smarty->assign("companyZipcode",$ARR["companyZipcode"]);
$smarty->assign("companyURL",$ARR["companyURL"]);
$smarty->assign("companyEmail",$ARR["companyEmail"]);
$smarty->assign("companyPhone",$ARR["companyPhone"]);
$smarty->assign("companyMobile",$ARR["companyMobile"]);
$smarty->assign("companyFax",$ARR["companyFax"]);
//echo $ARR["studentProvince"];
//show province wow
foreach($province_type as $key){
$tmp['value1'] = $key;
$tmp['province_name'] = $key;
if ($key == $ARR["companyProvince"])
{
$tmp['selected1'] = 'selected';
} else {
$tmp['selected1'] = '';
}
$data1[] = $tmp;
}
$smarty->assign("province_type",$data1);
//end province
// echo "1";
$smarty->assign("title_web",$title_website);
$smarty->assign("docs_path",$DirectoryURL);
#Êèǹ¢Í§¡Òà display
$smarty->display("company_info-edit.tpl");
?>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-03-24 09:47:09 |
By :
crazyaholic |
View :
769 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$SQL = "select * from crm_company_info where companyID = '".$id."' ;";// ตรงนี้ เอา ; ออก ข้างใน คำสั่ง Sql ด้วยครับ
|
|
|
|
|
Date :
2011-03-24 15:09:43 |
By :
compeng |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|