จะนำ สถานะของสมาชิกออกมาแสดงเป็นรายการ ในที่นี้จะแสดงเฉพาะ user
ฐานข้อมูล
Code
`acc_id` int(3) unsigned zerofill NOT NULL auto_increment,
`acc_user` varchar(10) NOT NULL,
`acc_pass` varchar(10) NOT NULL,
`acc_fname` varchar(50) NOT NULL,
`acc_lname` varchar(50) NOT NULL,
`acc_email` varchar(50) NOT NULL,
`acc_tel` varchar(10) NOT NULL,
`acc_address` text NOT NULL,
`acc_st` enum('admin','user','member') NOT NULL default 'user',
`acc_pic` longblob NOT NULL,
PRIMARY KEY (`acc_id`),
UNIQUE KEY `acc_user` (`acc_user`)
โค้ดที่มีปัญหา Code (PHP)
<?
mysql_connect("localhost","root","1234");
mysql_select_db("my");
$sql="select * from account order by acc_st";
$result=mysql_db_query($dbname,$sql);
while($record=mysql_fetch_array($result)) {
$count++;
if($record[acc_st]!="")
{continue;}
}
echo "<tr><td align='center'>$count</td><td align='center'>$record[acc_user]</td>"
?>
Tag : PHP
Date :
2011-05-28 07:28:50
By :
พัช
View :
754
Reply :
4
No. 1
Guest
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\my\list_status.php on line 6