Possible Duplicate:
PHP Error: mysql_fetch_array() expects parameter 1 to be resource, boolean given
I am coding an php and mysql program to add and retrieve facebook app id and secret in database.But I get the following error.My link is http://freegiveaway.info/new/manageApp.php .btw my database is connected successfully.
Warning: mysql_fetch_assoc() expects parameter 1 to be resource,
boolean given in /home/free/public_html/new/manageApp.php
My php contains follwing code
$flag = $_POST['flag'];
$key = $_POST['key'];
$secret = $_POST['secret'];
$deleteApp=$_POST['deleteApp'];
$appN=$_POST['appN'];
$db = mysql_connect("localhost", "free_1", "password");
mysql_select_db("facefunv_chuck", $db);
$app = mysql_query("SELECT * FROM tsp ORDER BY n",$db);
while ($apps = mysql_fetch_assoc($app)){
I get error on line while ($apps = mysql_fetch_assoc($app)){
And my sql file is below
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `facefunv_chuck`
--
-- --------------------------------------------------------
--
-- Table structure for table `tsp`
--
CREATE TABLE IF NOT EXISTS `tsp` (
`n` int(11) NOT NULL AUTO_INCREMENT,
`id` text NOT NULL,
`secret` text NOT NULL,
`restricted` int(11) NOT NULL,
`banned` int(11) NOT NULL,
PRIMARY KEY (`n`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=40 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;