|
 |
|
ช่วยแก้ให้หน่อยค่ะ มันขึ้น mysql_fetch_array(): supplied argument is not a valid MySQL result .... |
|
 |
|
|
 |
 |
|
คิวรี่ผิดคับ
ถ้าฟีล typelink เป็น ตัวเลข ก็ไม่ต้องใส่ ' ' นะครับ
|
 |
 |
 |
 |
Date :
2009-06-12 21:00:51 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\home\page.php on line 8
แก้แล้วก้อยังขึ้นเหมือนเดิมอ่ะค่ะ
TT
|
 |
 |
 |
 |
Date :
2009-06-12 21:14:22 |
By :
kahngiitz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอาโค้ดมาดูใหม่คับ ผมว่าคิวรี่ผิด
|
 |
 |
 |
 |
Date :
2009-06-12 21:17:01 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?
include "config.inc.php" ;
echo "<h1>ทุนวิจัย</h1>" ;
$result = mysql_query("SELECT * FROM home WHERE typelink=1") ;
while($r=mysql_fetch_array($result)) {
echo "<a href=\"".$r["link"]."\">".$r["name"]."</a><br/>" ;
}
?>
|
 |
 |
 |
 |
Date :
2009-06-12 21:17:51 |
By :
kahngiitz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอารายละเอียดฐานข้อมูล ตาราง home มาให้ดูหน่อยคับ
|
 |
 |
 |
 |
Date :
2009-06-12 21:20:11 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
CREATE TABLE `home` (
`id` int(5) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`link` varchar(255) NOT NULL,
`typelink` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
|
 |
 |
 |
 |
Date :
2009-06-12 21:22:28 |
By :
kahngiitz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$result = mysql_query("SELECT * FROM `home` WHERE typelink='1'");
ลองดูนะ
|
 |
 |
 |
 |
Date :
2009-06-12 21:26:10 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เป็นเหมือนเดิมค่ะ
TT
ไม่เข้าใจเลย
ว่าทำไมมันถึง error
|
 |
 |
 |
 |
Date :
2009-06-12 21:28:21 |
By :
kahngiitz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเอา
SELECT * FROM home WHERE typelink='1'
ไปสั่งบน phpmyadmin ดูครับ เผื่อจะได้คำตอบ
|
 |
 |
 |
 |
Date :
2009-06-12 21:29:40 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
TT
|
 |
 |
 |
 |
Date :
2009-06-12 21:46:07 |
By :
kahngiitz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณนะค่ะที่ช่วยหาวิธีแก้ไขให้
แต่ก้อไม่เข้าใจเหมือนมันว่าทำไมมันถึง error
ลองให้เพื่อน run ก้อใช้ได้ไม่มีปัญหา
TT
|
 |
 |
 |
 |
Date :
2009-06-12 21:56:33 |
By :
kahngiitz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่เห็นเปิดConnection เลยอ่ะครับ หรือผมเข้าใจผิดเอง
|
 |
 |
 |
 |
Date :
2009-06-12 22:09:50 |
By :
TreblesJ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Connection กับ database หรอค่ะ
ก้อทำแล้วค่ะ
|
 |
 |
 |
 |
Date :
2009-06-12 22:25:49 |
By :
kahngiitz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
mysql_query("SELECT * FROM home WHERE typelink='1'") or die(mysql_error());
|
 |
 |
 |
 |
Date :
2009-06-12 22:44:37 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณทุกคนมากๆนะค่ะที่มาช่วยแก้
ตอนนี้ไม่ error แล้วค่ะ
ปัญหาเกิดจากใส่ข้อมูลตอน connect db ผิดอ่ะค่ะ

|
 |
 |
 |
 |
Date :
2009-06-12 22:47:33 |
By :
kahngiitz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|