odbc_exec(): supplied argument is not a valid ODBC-Link resource คืออะไร
Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in D:\AppServ\www\ROY\show_student.php on line 58
ไม่ทราบว่าข้อความนี้หมายความว่าอะไรค่ะ
รบกวนพี่ๆช่วยตอบด้วยนะค่ะ หนูไม่ทราบจริงๆๆค่ะ และพยายามแก้ไขมาหลายวันแล้วไม่สามารถแก้ได้
หนูได้ตั้งค่า DSN แล้วและได้เก็บฐานข้อมูลไว้ใน D:\AppServ\www\ROY\student.mdb
<? include("dbconnect.php"); ?>
<form id="form1" name="form1" method="post" action="show_student.php">
<table width="2246" height="113" border="1">
<tr>
<td colspan="14" background="BG/9.jpg"><h5 align="center" class="style5"> STUDENTS FORM</h5></td>
</tr>
<tr>
<td width="115"><h5 align="center" class="style5">Student ID</h5></td>
<td width="161"><h5 align="center" class="style5">Titlename </h5></td>
<td width="161"><h5 align="center" class="style5">Firstname </h5></td>
<td width="161"><h5 align="center" class="style5">Lastname</h5></td>
<td width="161"><h5 align="center" class="style5">Birth</h5></td>
<td width="161"><h5 align="center" class="style5">Address</h5></td>
<td width="161"><h5 align="center" class="style5">E-mail</h5></td>
<td width="161"><h5 align="center" class="style5">ID Card</h5></td>
<td width="161"><h5 align="center" class="style5">Telephone</h5></td>
<td width="161"><h5 align="center" class="style5">username </h5></td>
<td width="184"><h5 align="center" class="style5">Course name </h5></td>
<td width="123"><h5 align="center" class="style5">Edit</h5></td>
</tr>
<?php
$sql_applicant = " select
`student`.`studentID` AS `studentID`,
`student`.`titlename` AS `titlename`,
`student`.`firstname` AS `firstname`,
`student`.`lastname` AS `lastname`,
`student`.`birth` AS `birth`,
`student`.`address` AS `address`,
`student`.`email` AS `email`,
`student`.`IDcard` AS `IDcard`,
`student`.`phone` AS `phone`,
`student`.`username` AS `username`,
`course`.`coursename` AS `coursename`
from
(`course` join `student` on((`course`.`courseID` = `student`.`courseID`))) ";
$query_applicant = odbc_exec($sql_applicant, $connect_db) or die(mysql_error());
$row_applicant = odbc_fetch_row($query_applicant );
$Num_Rows = odbc_num_fields($query_applicant);
while ($row_applicantr = odbc_fetch_row($query_applicant));
{
?>
<tr>
<td><div align="center"><? print $row_applicant[studentID]; ?> </div></td>
<td><div align="center"><? print $row_applicant[titlename]; ?> </div></td>
<td><div align="center"><? print $row_applicant[firstname]; ?> </div></td>
<td><div align="center"><? print $row_applicant[lastname]; ?> </div></td>
<td><div align="center"><? print $row_applicant[birth]; ?> </div></td>
<td><div align="center"><? print $row_applicant[address]; ?> </div></td>
<td><div align="center"><? print $row_applicant[email];?></div></td>
<td><div align="center"><? print $row_applicant[IDcard]; ?> </div></td>
<td><div align="center"><? print $row_applicant[phone]; ?> </div></td>
<td><div align="center"><? print $row_applicant[username]; ?> </div></td>
<td><div align="center"><? print $row_applicant[coursename]; ?></div></td>
<td><div align="center"><a href="edit_student.php?edit_ID=<? print $row_applicant[studentID];?>"> Edit</a></div></td>
</tr>
<?
}
?>
</table>
</form>
ขอบพระคุณพี่มากค่ะ
</body>
</html>Tag : - - - -
Date :
2009-08-22 01:55:40
By :
bear48
View :
2334
Reply :
4
เอาโค๊ด connect มาดูหน่อยครับ
Date :
2009-08-22 07:08:21
By :
deawx
odbc คงไม่รู้จัก ` ` อันนี้ละมั้งครับ ลองเอาออกให้หมดเลยครับ
`student` > student
Date :
2009-08-22 10:47:48
By :
lozomac
<?php
$hostname_database = "localhost";
$database_db = "student";
$username_db = "";
$password_db = "";
$connect_db = odbc_connect($database_db , $username_db, $password_db)
or trigger_error(mysql_error(),E_USER_ERROR);
?>
เป็น code connect ค่ะ
Date :
2009-08-22 22:24:01
By :
bear48
ลบออกแล้วนะค่ะก็ยังเหมือนเดิมค่ะ
ไม่ทราบว่าเกิดจากสาเหตุอะไรค่ะ
Date :
2009-08-23 00:34:15
By :
bear48
Load balance : Server 02