I have this error message
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/coralgab/public_html/realestate/index.php on line 13
1<?php
2extract($HTTP_GET_VARS);
3extract($HTTP_POST_VARS);
4if($sid!=""){
5session_id($sid);
6}
7session_start(); // start up your PHP session!
8$sess_id=session_id();
9include("conf.php");
10$db=mysql_connect($db_host,$database_user,$database_pass) or die("<b>MySQL Error:</b> Unable to connect to database please check that you have provided 11the correct <li>Database Login username<li>Database Login Password"); //Connect to database or give error if failed
12mysql_select_db($db_name,$db)or die("<b>MySQL Error:</b> Unable to select database please check that you have provided the correct <li>Database name");
13$bddet=mysql_query("SELECT * FROM real_estate_ad");
14$op_tem=mysql_fetch_array($bddet);
15$main_c=$op_tem[web_color];
16if($action=="logout"){
17if(isset($_SESSION['loged'])){
18session_destroy();
19}
20}
21if($action=="dologin"){
22if($name!=""){
23$list = mysql_query("SELECT * FROM user_real_estate_info WHERE uid = '$name' AND pwd='$password'");
24}else if(isset($_SESSION['loged'])){
25$buser=base64_decode($_SESSION['loged']);
26$list = mysql_query("SELECT * FROM user_real_estate_info WHERE uid = '$buser'");
27}
28$num=0;
29if(isset($_SESSION['loged'])||strlen($name)>=1){
30$num=mysql_num_rows($list);
31}
32if($num==1){
33$_SESSION['loged'] = base64_encode($name);
34}
35}
36if(isset($_SESSION['loged'])||$action!="logout"){
37$mainlinks="<TR bgcolor=$main_c><TD width=10%> <a href=?action=dologin><FONT COLOR=#ffffff>Home</FONT></a></TD><TD width=15%><a 38href=?action=inbox><FONT COLOR=#ffffff width=15%>Inbox</FONT></a></TD><TD width=15%><a href=?action=compose><font color=#ffffff >Compose</a></TD><TD 39width=15%><a href=?action=manage><FONT COLOR=#ffffff>Manage Listings</FONT></a></TD><TD width=15%><a href=?action=add_listing><FONT COLOR=#ffffff>Add 40Listing</a></TD><TD width=15%><a href=?action=logout&s=$s><FONT COLOR=#ffffff>Logout</font></a></TD></TR>";
41}else{
42$mainlinks = "<TR bgcolor=$main_c><TD width=20%> <a href=?home><FONT COLOR=#ffffff>Home</FONT></a></TD><TD width=20%><a 43href=index.php?action=login><FONT COLOR=#ffffff>Login</FONT></a></TD><TD width=20%><a href=index.php?action=join><FONT COLOR=#ffffff>Join</a></TD><TD 44width=20%><a href=index.php?action=contact_us><FONT COLOR=#ffffff>Contact Us</a></TD><TD width=20%><a href=index.php?action=advertise><FONT 45COLOR=#ffffff>Advertising info</font></a></TD></TR>";
46}
47echo"<BODY bgColor=#ffffff leftMargin=0 topMargin=0>";
48include("template/new.html");
49?>
thank you