|
|
|
งง จังเลยครับ Query ผมผิดตรงไหนทำไมมันบอกว่า Error รบกวนด้วยครับ |
|
|
|
|
|
|
|
งง จังเลยครับ Query ผมผิดตรงไหนทำไมมันบอกว่า Error รบกวนด้วยครับ
DB
Code (PHP)
<?
include "include/connect.php";
?>
<table border="0" cellspacing="0" cellpadding="0" width="1200" height="617" align="center" bgcolor="#FFFFFF">
<tr height="94">
<td width="1%" bgcolor="#FFFFFF"> </td>
<td width="250"><img src="images/DittoLogo.jpg" width="250" height="94" /></td>
<td width="80%" bgcolor="#FFFFFF" align="right"> </td>
<td width="1%" height="94" bgcolor="#FFFFFF"></td>
</tr>
<tr bgcolor="#FFFFFF" height="20">
<td> </td>
<td > </td>
<td align="right" valign="top"><? include "include/service_menu.php"; ?></td>
<td ></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="411" align="center" valign="top" > </td>
<td colspan="2" align="center" valign="top" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#00CCFF">
<td width="2%"> </td>
<td align="right"><form name="frmSearch" method="get" action="<?php echo $_SERVER['SCRIPT_NAME'];?>">
<table width="599" border="0">
<tr>
<th align="right">Service Code
<input name="txtKeyword" type="text" id="txtKeyword" value="<?php echo $_GET["txtKeyword"];?>">
<input type="submit" value="Search"></th>
</tr>
</table>
</form></td>
<?php
if($_GET["txtKeyword"] != "")
{
$strSQL = "SELECT
T0.insID,
T0.customer,
T0.custmrName,
T0.manufSN,
T0.internalSN,
T0.itemCode,
T0.street,
T0.block,
T0.zip,
T0.city,
T0.status,
T0.U_ServiceContract,
T1.firstName, T1.lastName, T1.middleName
FROM
OINS T0 INNER JOIN OHEM T1 ON T0.technician = T1.empID
WHERE
(manufSN LIKE '%".$_GET["txtKeyword"]."%')
AND T0.status = 'A'
AND (T0.U_ServiceContract = 'R' OR T0.U_ServiceContract = 'SDS' OR T0.U_ServiceContract = 'T' OR T0.U_ServiceContract = 'DEMO' OR T0.U_ServiceContract = 'OFF')";
$objQuery = odbc_exec($cid, $strSQL) or die ("Error Execute [".$strSQL."]");
$objResultAll = odbc_fetch_array($objQuery);
}
?>
<?
if($_GET["txtKeyword"] != "")
{
$StrSql = "Select * from picupload WHERE ServiceCode LIKE '%".$_GET["txtKeyword"]."%'";
$objQuery = mysql_query($StrSql) or die ("Error Query [".$StrSql."]");
$objResult = mysql_fetch_array($objQuery);
}
?>
<td width="2%"> </td>
</tr>
<tr>
<td bgcolor="#00CCFF"> </td>
<td align="center" valign="top"><table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td >
</td>
</tr>
</table></td>
<td bgcolor="#00CCFF"> </td>
</tr>
<tr>
<td bgcolor="#00CCFF" > </td>
<td align="center" valign="top"><table width="98%" border="1" cellspacing="0" cellpadding="8" bordercolor="#000000">
<tr>
<td colspan="8" bgcolor="#CC99FF"><div align="center" class="style14">รายละเอียดเครื่อง</div></td>
</tr>
<tr>
<td width="11%" bgcolor="#CCFFFF"><div align="left" class="style14">Customer Cards</div></td>
<td width="44%" colspan="4" ><span class="style14"><?=$objResultAll["customer"];?></span></td>
<td width="45%" rowspan="9" ><form action="php_multiple_upload2.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<br />
<table width="98%" border="1" cellpadding="0" cellspacing="0">
<tr class="style14">
<th bgcolor="#CE9CFF" scope="col">รายการ</th>
<th align="center" bgcolor="#CE9CFF" scope="col">ชื่อรูปภาพ</th>
<th align="center" bgcolor="#CE9CFF" scope="col">อัพโหลด</th>
</tr>
<tr>
<th width="23%" bgcolor="#CEFFFF" class="style14" scope="col">Service Code</th>
<th width="30%" align="left" scope="col"><input type="text" name="txtGalleryName1" /></th>
<th width="47%" align="right" scope="col"><input type="file" name="fileUpload1" /></th>
</tr>
<tr>
<th bgcolor="#CEFFFF" class="style14" scope="row">Serial No.</th>
<td><input type="text" name="txtGalleryName2" /></td>
<td align="right"><input type="file" name="fileUpload2" /></td>
</tr>
<tr>
<th bgcolor="#CEFFFF" class="style14" scope="row">Body1</th>
<td><input type="text" name="txtGalleryName3" /></td>
<td align="right"><input type="file" name="fileUpload3" /></td>
</tr>
<tr>
<th bgcolor="#CEFFFF" class="style14" scope="row">Body2</th>
<td><input type="text" name="txtGalleryName4" /></td>
<td align="right"><input type="file" name="fileUpload4" /></td>
</tr>
<tr>
<th bgcolor="#CEFFFF" class="style14" scope="row">Match</th>
<td colspan="2"><label for="match"></label>
<select name="match" size="1" id="match">
<option value="" selected="selected">Please Select</option>
<option value="0">Match</option>
<option value="1">Not Match</option>
</select></td>
</tr>
</table>
<br />
<input name="btnSubmit" type="submit" value="Upload" />
<input name="btnSubmit2" type="reset" value="Reset" />
<br />
<input name="hdnLine" type="hidden" value="4" />
</form></td>
</tr>
<tr>
<td bgcolor="#CCFFFF"><div align="left" class="style14">Name</div></td>
<td colspan="4" ><span class="style14">
<?=iconv('windows-874','UTF-8',$objResultAll["custmrName"]);?>
</span></td>
</tr>
<tr>
<td bgcolor="#CCFFFF"><div align="left" class="style14">Address</div></td>
<td colspan="4" ><span class="style14"><?=iconv('windows-874','UTF-8',$objResultAll["street"].$objResultAll["block"].$objResultAll["city"]);?>
</span></td>
</tr>
<tr>
<td bgcolor="#CCFFFF"><div align="left" class="style14">Service Code</div></td>
<td colspan="4" ><span class="style14">
<?=$objResultAll["manufSN"];?>
</span></td>
</tr>
<tr>
<td bgcolor="#CCFFFF"><div align="left" class="style14">Serial No.</div></td>
<td colspan="4" ><span class="style14">
<?=iconv('windows-874','UTF-8',$objResultAll["internalSN"]);?>
</span></td>
</tr>
<tr>
<td bgcolor="#CCFFFF"><div align="left" class="style14">Status</div></td>
<td colspan="4" ><?=$objResultAll["status"];?></td>
</tr>
<tr>
<td bgcolor="#CCFFFF"><div align="left" class="style14">Service Contract</div></td>
<td colspan="4" ><?=$objResultAll["U_ServiceContract"];?></td>
</tr>
<tr>
<td bgcolor="#CCFFFF"><div align="left" class="style14">Technician</div></td>
<td colspan="4" ><?=iconv('windows-874','UTF-8',($objResultAll["middleName"].' '.$objResultAll["firstName"].' '.$objResultAll["lastName"]));?></td>
</tr>
<tr>
<td bgcolor="#CCFFFF"><div align="left" class="style14">Upload Detail</div></td>
<td ><?=$objResult1["TimeUpload"];?></td>
<td ><?=$objResult1["ServiceCode"];?></td>
<td ><?=$objResult1["SerialNo"];?></td>
<td ><?=$objResult1["MatchUpload"];?></td>
</tr>
<tr>
<td colspan="8" bgcolor="#CC99FF"><div align="center" class="style14"></div></td>
</tr>
</table>
</td>
<td bgcolor="#00CCFF"> </td>
</tr>
<tr>
<td bgcolor="#00CCFF"> </td>
<td> </td>
<td bgcolor="#00CCFF"> </td>
</tr>
<tr bgcolor="#00CCFF">
<td> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
<td > </td>
</tr>
<tr bgcolor="#FFFFFF">
<td > </td>
<td > </td>
<td > </td>
<td ></td>
</tr>
<tr bgcolor="#FFFFFF">
</tr>
</table>
</body>
</html>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2016-06-15 14:31:40 |
By :
karurub |
View :
735 |
Reply :
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองให้มันแสดงออกมาดูครับว่า Error อะไร
Code (PHP)
$objQuery = mysql_query($StrSql) or die ("Error Query [".$StrSql."] : ".mysql_error());
|
|
|
|
|
Date :
2016-06-15 15:04:59 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอาสคริปในไฟล์ connect.php มาดูครับ
|
|
|
|
|
Date :
2016-06-15 16:50:10 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
//** MySql **//
$host= "localhost" ;
$userr="root";
$pwd= "Abc@1234" ;
$dbname="dbhelpCrm";
$c = mysql_connect($host ,$userr ,$pwd) ;
mysql_select_db($dbname,$c);
mysql_query("SET NAMES UTF8");
If (!$c) {
echo "<h3> ERROR : ไม่สามารถติดต่อ DB</h3>" ;
exit ();
}
|
|
|
|
|
Date :
2016-06-15 16:51:50 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไมไม่ใช้ mysqli ไปเลย
|
|
|
|
|
Date :
2016-06-15 17:21:40 |
By :
progamer2000 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|