|
|
|
ช่วยหน่อยครับ [Microsoft][ODBC Microsoft Access Driver] Join expression not supported |
|
|
|
|
|
|
|
มัน error
[Microsoft][ODBC Microsoft Access Driver] Join expression not supported....on line 71
ครับ ผมไม่รู้ว่ามันผิดยังไง เหมือนจะเป็นที่คำสั่ง select db หรือเปล่า แต่ผมก็ copy มาจากอีกอันหนึ่งเลยน่ะครับ อีกหน้าหนึ่งมันก็ใช้ได้
Code (PHP)
<?php ob_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ข้อมูล Center</title>
<script type="text/javascript">
function showdetail(Person_sel)
{
var Extension_No = document.getElementById('Extension_No');
var Email_Address = document.getElementById('Email_Address');
<?php
include "connect.php";
$conn->open($sql);
$strSQL = "SELECT Table_User_Info.Extension_No, Table_User_Info.Email_Address, Table_User_Info.ID_PersonalNo FROM Table_User_Info";
$objQuery = $conn->execute($strSQL);
$intRows = 0;
while(!$objQuery->EOF)
{
$intRows++;
?>
x = <?=$intRows;?>;
mySubList = new Array();
strGroup = <?=$objQuery->Fields['ID_PersonalNo']->Value?>;
strExten = "<?=$objQuery->Fields['Extension_No']->Value?>";
strmail = "<?=$objQuery->Fields['Email_Address']->Value?>";
mySubList[x,0] = strGroup;
mySubList[x,1] = strBud;
mySubList[x,2] = strAcc;
if (mySubList[x,0] == Person_sel)
{
strExten.value = strExten;
strmail.value = strmail;
return ;
}
else
{
strExten.value = "-";
strmail.value = "-";
}
<?php
$objQuery->MoveNext();
}
$objQuery->Close();
$conn->Close();
?>
}
</script>
</head>
<body>
<div align="center" >
<h1>ข้อมูล Center และ Function</h1>
<form action="Center.php" method="get" name="form1" id="form1">
<p>ค้นหา Center No.
<input name="Search_Center" type="text" id="Search_Center" />
<input type="submit" name = "submit_search" id = "submit_search" value="ค้นหา" />
</p>
</form>
</div>
<p>
<?php
include "connect.php";
if($_GET['submit_search'] != "")
{
$conn->open($sql);
$rs = $conn->execute("SELECT Table_Center_Info.CenterNo, Table_User_Info.Name_Surname, Table_User_Info.Extension_No, Table_User_Info.Email_Address, Table_Center_Owner.ID_Center_Owner FROM Table_User_Info INNER JOIN (Table_Center_Info INNER JOIN Table_Center_Owner ON Table_Center_Info.ID_Center_Info = Table_Center_Owner.ID_Center_Info) ON Table_User_Info.ID_PersonalNo = Table_Center_Owner.ID_PersonalNo AND Table_Center_Info.CenterNo like '%".$_GET['Search_Center']."%'");
?>
<table width="1024" border="1" align="center" cellpadding="2" cellspacing="0">
<tr>
<th width="135" align="center">Center No.</th>
<th width="131" align="center">ผู้ประสานงาน</th>
<th width="151" align="center">เบอร์โทรศัพท์</th>
<th width="129" align="center">E-Mail</th>
<th width="84" align="center">จัดการ</th>
</tr>
<?php
while (!$rs->EOF)
{
?>
<tr>
<td align="center"><a href="Center.php?&ID_Center_Info=<?=$rs->Fields['ID_Center_Owner']->Value?>"><?=$rs->Fields['CenterNo']->Value?></a></td>
<td align="center"><?=$rs->Fields['Name_Surname']->Value?></td>
<td align="center"><?=$rs->Fields['Extension_No']->Value?></td>
<td align="center"><?=$rs->Fields['Email_Address']->Value?></td>
<td align="center"><a href="Center.php?Mod=edit&ID_Contract_Info=<?=$rs->Fields['ID_Center_Owner']->Value?>">Edit</a> <a href="JavaScript:if(confirm('Confirm Delete?')==true){window.location='Contract.php?Mod=del&ID_Contract_Info=<?=$rs->Fields['ID_Center_Owner']->Value?>';}">Delete</a></td>
</tr>
<?php
$rs->MoveNext() ; //ขึ้นแถวใหม่
}
$rs->Close();
$conn->Close();
?>
</table>
<div align="center">
<form action="Center.php?Mod=new" method="post" name="form2" id="form2">
<input name="Submit" type="submit" value="New">
</form>
</div>
<?php
}//ปิด Search_Butt
?>
</p>
<?php
if($_GET['Mod'] == "new")
{
if($_POST['submit_new'] != "")
{
$conn->open($sql);
$str = "Insert Into Table_Center_Info (`CenterNO`) values(".$_POST['CenterNo'].");";
$rs = $conn->execute($str);
$str = "Select MAX(ID_Center_Info) AS Max_ID_Cen From Table_Center_Info";
$rs = $conn->execute($str);
$Max_ID_Cen = $rs->Fields['Max_ID_Cen']->Value;
$str1 = "Insert Into Table_Center_Owner (`ID_Center_Info`,`ID_PersonalNo`) values(".$Max_ID_Cen.",".$_POST['ID_Contract_Info'].");";
$rs = $conn->execute($str1);
header("Location: Center.php?submit_search=Search");
}//ปิด Submit_save
?>
<table width="1024" border="1" align="center" cellpadding="2" cellspacing="0">
<tr>
<th width="112" align="center">Center No.</th>
<th width="131" align="center">ผู้ประสานงาน</th>
<th width="151" align="center">เบอร์โทรศัพท์</th>
<th width="129" align="center">E-Mail</th>
<th width="84" align="center">จัดการ</th>
</tr>
<form action="Center.php?Mod=new" method="post" name="form_newcen" id="form_newcen">
<tr>
<td align="center"><input name="CenterNo" type="text" value=""></td>
<td align="center">
<select name="ID_Contract_Info" id="ID_Contract_Info" onchange="showdetail(this.value);">
<?php
$conn->open($sql);
$str = "SELECT * FROM Table_User_Info";
$rs = $conn->execute($str);
while (!$rs->EOF)
{
?>
<option value="<?=$rs->Fields['ID_PersonalNo']->Value?>"><?=$rs->Fields['Name_Surname']->Value?></option>
<?php
$rs->MoveNext();
} //ปิด while
$rs->Close();
$conn->Close();
?>
</select>
</td>
<td align="center"><input name="Extension_No" id="Extension_No" type="text" readonly="readonly" size="10" value="" /></td>
<td align="center"><input name="Email_Address" id="Email_Address" type="text" readonly="readonly" size="10" value="" /></td>
<td align="center"><input name="Submit_New" type="submit" value="Save" /></td>
</tr>
</form>
</table>
<?php
}
?>
</body>
</html>
ขอบคุณมากครับ
Tag : PHP, Ms Access, JavaScript
|
|
|
|
|
|
Date :
2011-03-18 14:22:47 |
By :
PikaboyZ |
View :
1154 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เป็นที่คำสั่ง JOIN ครับ
|
|
|
|
|
Date :
2011-03-18 17:15:08 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|