|
 |
|
ผมอยากติดต่อข้อมูลเป็น DSNLess ต้องแก้โค้ดยังไงครับ... |
|
 |
|
|
 |
 |
|
โค้ดที่เห็นนี้ ก็ โมดิฟาย แก้ไข เอาไปจากเวบนี้แหละครับ
ไม่ได้เรียนมา อาศัย ลองผิดลองถูกไปเรื่อยๆ
เหตุผลที่อยากติดต่อข้อมูลเป็น DSNLess เพราะ จะไม่ใช้บนวินโด้วส์
จะไปลองใช้งานบนลินุกซ์ แทนครับ
ขอบคุณล่วงหน้าครับผม
Code (PHP)
<html>
<head>
<title>...Live From LIB. Room</title>
</head><meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<body>
<a href = "index.php">Home</a>
<a href = "page1.php">ศิลปิน</a>
<a href = "page1a.php">ชื่อเล่น</a>
<a href = "page2.php">เพลง</a>
<a href = "page3.php">อัลบั้ม</a>
<a href = "page4.php">ผู้กำกับ</a>
<a href = "page5.php">ภาพยนตร์</a>
<div style=font-size:6px;position:fixed;right:0px;bottom:0px><a>Create by Chin</a></div><hr width=100%" size="1" color="silver" align="center">
<center>
<form name="frmSearch" method="get" action="<?=$_SERVER['SCRIPT_NAME'];?>">
<table width="600" border="0">
<th>กรอก Keyword หรือ คำค้นหา ที่นี่
<input name="txtKeyword" type="text" id="txtKeyword" value="<?=$_GET["txtKeyword"];?>">
<input type="submit" value="Search"></th>
</tr>
</table>
</form><tr>
<?
if($_GET["txtKeyword"] != "")
{
$objConnect = odbc_connect("mrchin1","","chvthai99") or die("Error Connect to Database");
// Search By Name or Email
$strSQL = "SELECT * FROM Book WHERE (AuthorName LIKE '%".$_GET["txtKeyword"]."%' or StoryName LIKE '%".$_GET["txtKeyword"]."%' or SubStoryName LIKE '%".$_GET["txtKeyword"]."%' )";
$objExec = odbc_exec($objConnect, $strSQL) or die ("Error Execute [".$strSQL."]");
?>
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<th width="10" bgcolor="#01DF74"> <div align="center">Num </div></th>
<th width="10" bgcolor="#01DF74"> <div align="center">MASTER </div></th>
<th width="10" bgcolor="#01DF74"> <div align="center">LF </div></th>
<th width="10" bgcolor="#01DF74"> <div align="center">OV </div></th>
<th width="15" bgcolor="#01DF74"> <div align="center">EDIT </div></th>
<th width="100" bgcolor="#01DF74"> <div align="center">ID </div></th>
<th width="100" bgcolor="#01DF74"> <div align="center">ARTIST </div></th>
<th width="50" bgcolor="#01DF74"> <div align="center">NICK </div></th>
<th width="100" bgcolor="#01DF74"> <div align="center">TITLE </div></th>
<th width="100" bgcolor="#01DF74"> <div align="center">ALBUM </div></th>
<th width="100" bgcolor="#01DF74"> <div align="center">DIR </div></th>
<th width="20" bgcolor="#01DF74"> <div align="center">LABEL </div></th>
<th width="100" bgcolor="#01DF74"> <div align="center">Remark </div></th>
<th width="100" bgcolor="#01DF74"> <div align="center">More </div></th>
<th width="20" bgcolor="#01DF74"> <div align="center">Date</div></th>
</tr><div style="text-align: right;"><input type="button" value="สั่งพิมพ์หน้านี้" onClick="window.print()"></div>
<?
while($objResult = odbc_fetch_array($objExec))
{
?>
<tr>
<td bgcolor="#F8E0EC" style="font-size:13px"><?=$objResult["BookRegister"];?></div></td>
<td bgcolor="#F8E0EC" style="font-size:13px"><?=$objResult["MoungNum"];?></td>
<td bgcolor="#F8E0EC" style="font-size:13px"><?=$objResult["Volum"];?></td>
<td bgcolor="#F8E0EC" style="font-size:13px"><?=$objResult["Original V"];?></td>
<td bgcolor="#F8E0EC" style="font-size:13px"><?=$objResult["Search1"];?></td>
<td bgcolor="#E6E6E6" style="font-size:13px"><?=$objResult["LabudNum"];?></td>
<td bgcolor="#E6E6E6" style="font-size:13px"><?=$objResult["AuthorName"];?></td>
<td bgcolor="#E6E6E6" style="font-size:13px"><?=$objResult["AddAuthor"];?></td>
<td bgcolor="#E6E6E6" style="font-size:13px"><?=$objResult["StoryName"];?></td>
<td bgcolor="#E6E6E6" style="font-size:13px"><?=$objResult["SubStoryName"];?></td>
<td bgcolor="#E6E6E6" style="font-size:13px"><?=$objResult["Director"];?></td>
<td bgcolor="#E6E6E6" style="font-size:13px"><?=$objResult["LABEL"];?></td>
<td bgcolor="#E6E6E6" style="font-size:13px"><?=$objResult["Remark"];?></td>
<td bgcolor="#E6E6E6" style="font-size:13px"><?=$objResult["Seealso"];?></td>
<td bgcolor="#E6E6E6" style="font-size:13px"><?=$objResult["RecieveDatE"];?></div></td>
</tr>
<?
}
?>
</table>
<?
odbc_close($objConnect);
}
?>
</body>
<br>
<SCRIPT LANGUAGE="Javascript"><!--
// ***********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************
// Get today's current date.
var now = new Date();
// Array list of days.
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
// Array list of months.
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}
// Join it all together
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;
// Print out the data.
document.write("Today\'s date is " +today+ ".");
//--></SCRIPT>
<br>
</center></html>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-12-01 15:05:20 |
By :
xcrack2005 |
View :
945 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
odbc ทำงานบน windows น่ะครับ
|
 |
 |
 |
 |
Date :
2009-12-01 15:32:08 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ครับผม สเตบแรก จะติดต่อ แบบ DSNLess บนวินโด้วส์ก่อน
ขั้นต่อไป จะไปลองบน ลินุกซ์ครับ
|
 |
 |
 |
 |
Date :
2009-12-01 15:51:31 |
By :
xcrack2005 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|