0

Hi, I'm getting this error

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\Adult\index.php on line 155

Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in C:\wamp\www\Adult\index.php on line 261

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\Adult\index.php on line 301

Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in C:\wamp\www\Adult\index.php on line 418

Here is my index file

<?php
include("_main.header.php");
?>
<style type="text/css">
<!--
.style1 {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}
body,td,th {
    color: #FFFFFF;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}
body {
    background-color: #333333;
}
a:link {
    color: #99CC00;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #99CC00;
}
a:hover {
    text-decoration: none;
    color: #99FF00;
}
a:active {
    text-decoration: none;
    color: #99CC00;
}
.style4 {font-family: Arial, Helvetica, sans-serif}
.style5 {color: #FFFFFF}
-->
</style>

<table width="720" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#333333">

  <tr>

    <td height="24" align="center" class="form_definitions"><div align="left"> &nbsp;&nbsp;&nbsp;<span class="style4">There are

        <? 

          $nTime=time(); 



          //we set the status to offline to models that have not changed theyr status for 30 seconds

          mysql_query("UPDATE chatmodels SET status='offline' WHERE $nTime-lastupdate>30 AND status!='rejected' AND status!='blocked' AND status!='pending'");



          if (!isset($_GET['category']))

            {

            $select="SELECT * FROM chatmodels WHERE status='online'";//100hours

            } else{

            $select="SELECT * FROM chatmodels WHERE category='$_GET[category]' AND status='online'";

            }

            $result = mysql_query($select);

            $nOnline=mysql_num_rows($result);

            mysql_free_result($result);



            if (!isset($_GET['category']))

            {

            $select="SELECT * FROM chatmodels WHERE status!='pending' AND status!='rejected'";

            } else{

            $select="SELECT * FROM chatmodels WHERE category='$_GET[category]' AND  status!='pending' AND status!='rejected'";

            }

            $result = mysql_query($select);

            $nTotal=mysql_num_rows($result);

            mysql_free_result($result);



          echo $nOnline;

          ?>

    models online out of <? echo $nTotal;?> registered models.</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<? if (isset($_COOKIE["usertype"])){



    echo '<a href="cp/'.$_COOKIE["usertype"].'/index.php"><img src="images/member_area.png" border="0" ></a>';





    echo '<a href="logout.php"><img src="images/logout.png" border="0" ></a>';

    } else {

    //echo '<a href="login.php"><img src="images/header_6.gif" border="0"></a>';

    }?></div></td>
  </tr>
</table>

<table width="720" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#333333">

  <tr>

    <td align="center" valign="top"><?php echo '<table width="720" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">';



            $count=0;

            $nTime=time();





            if (!isset($_GET['category']))

            {

            $select="SELECT * FROM chatmodels WHERE status='online'";//100hours

            } else{

            $select="SELECT * FROM chatmodels WHERE category='$_GET[category]' AND status='online'";

            }





            $result = mysql_query($select);

            while($row = mysql_fetch_array($result)) 

                {           


                $tBirthD=$row[birthDate];

                $nYears=date('Y',time()-$tBirthD)-1970;



                $username=$row[user];

                $tempMessage=$row[message];

                $tempCity=$row[city];

                $tempPlace=$row[broadcastplace];

                $tempL1=$row[language1];

                $tempL2=$row[language2];

                $status=$row[status];












                $count++;

                if ($count==1) {echo' <tr>';}

                echo '<td width="178" height="180" align="center" valign="middle" background="images/modelbox.gif">';

                echo '<table width="178" height="180" border="0" cellpadding="2" cellspacing="1">';

                echo '<tr>';

                echo '<td height=10 align="center" valign="top"><span class="modelbox_title">'.$username .'</span></td>';

                echo '</tr><tr>';

                echo '<tr>';


                echo '<td height=80 align="center" valign="middle"><a href="liveshow.php?model='.$username.'"><img src="models/'.$username.'/thumbnail.jpg" width="140" height="105" border="0"></td>';


                echo '</tr><tr>';

                echo '<td height=26 align="left" valign="top">';

                echo '<span class="model_title_small">';

                echo '<span class="model_message">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp;'.$status.'</span><br>';

                    //echo '<span class="model_message">&nbsp&nbsp&nbsp&nbsp&nbsp'.$tempMessage.'</span></td>';

                echo '</tr></table>';

                echo '  </td>';

                if ($count==4){ echo"</tr>"; $count=0;}

                }





            if ($count==1){

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'</tr>';

            } else if ($count==2){

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'</tr>';

            } else if ($count==3){

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'</tr>';

            }



            mysql_free_result($result);

            echo'</table>';

            ?></td>

  </tr>

</table>

<table width="720" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#333333">

  <tr>

    <td align="center" valign="top"><strong><?php echo '<table width="720" border="0" align="center" cellpadding="0" cellspacing="1">';

            include("dbase.php");

include("settings.php");

            $count=0;

            $nTime=time();

            if (!isset($_GET['category']))

            {

            $select="SELECT * FROM chatmodels WHERE status='offline'";

            } else{

            $select="SELECT * FROM chatmodels WHERE category='$_GET[category]' AND status='offline'";

            }



            $result = mysql_query($select);

            while($row = mysql_fetch_array($result)) 

                {           

                $tBirthD=$row['birthDate'];

                $nYears=date('Y',time()-$tBirthD)-1970;



                $tempMessage=$row['message'];

                $username=$row['user'];

                $tempCity=$row['city'];

                $tempPlace=$row['broadcastplace'];

                $tempL1=$row['language1'];

                $tempL2=$row['language2'];  

                $tempL3=$row['language3'];  

                $tempL4=$row['language4'];  

                $status=$row['status'];


                $languagestring=$tempL1;

                if (strtolower($tempL2)!="none"){

                $languagestring.= ", ".$tempL2;

                }

                if (strtolower($tempL3)!="none"){

                $languagestring.= ", ".$tempL3;

                }

                if (strtolower($tempL4)!="none"){

                $languagestring.= ", ".$tempL4;

                }

                $count++;

                if ($count==1) {echo' <tr>';}

                echo '<td width="178" height="180" align="center" valign="middle" background="images/modelbox.gif">';

                echo '<table width="178" height="180" border="0" cellpadding="2" cellspacing="1">';

                echo '<tr>';

                echo '<td height=10 align="center" valign="top"><span class="modelbox_title">'.$username .'</span></td>';

                echo '</tr><tr>';

                echo '<tr>';

                    echo '<td height=80 align="center" valign="middle"><img src="models/'.$username.'/thumbnail.jpg" width="140" height="105" border="0"></td>';

                echo '</tr><tr>';

                    echo '<td height=26 align="left" valign="top">';

                    echo '<span class="model_title_small">';

                    echo '<span class="model_message">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp;'.$status.'</span><br>';

                    //echo '<span class="model_message">&nbsp&nbsp&nbsp&nbsp&nbsp'.$tempMessage.'</span></td>';

                echo '</tr></table>';

                echo '  </td>';

                if ($count==4){ echo"</tr>"; $count=0;}

                }





            if ($count==1){

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'</tr>';

            } else if ($count==2){

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'</tr>';

            } else if ($count==3){

            echo'<td width="240"  height="120" align="center" valign="middle">&nbsp</td>';

            echo'</tr>';

            }



            mysql_free_result($result);

            echo'</table>';

            ?></strong></td>
  </tr>
</table>

<?
include("_main.footer.php");
?>

Here is Dbase.php

<?
$linkID = mysql_connect("localhost","Database user name here", "database password here")
        or exit("Could not connect");

mysql_select_db ("MySql database name here");

?>

Here is Setting.php

<?php
//Example FMS or FCS: $connection_string="rtmp://camscripts.rtmphost.com/adult/";
$connection_string="rtmp://your_FMS_account.rtmphost.com/ppv/";

$sitename="Pay per View minute Video Chat Script";
//site url
$siteurl="http://ppv.camscripts.com";
//used in registration mails, payment mails...
$registrationemail="support@fmsdesigns.com";
$feedbackemail="support@fmsdesigns.com";
$paymentemail="support@camscripts.com";
//used for favorites announcements
$contactemail="support@fmsdesigns.com";
$newsletteremail="support@fmsdesigns.com";
//numbner of hours between giving another 300 seconds of free chat.
$freehours=1;
//default sop epercentage
$sopepercentage=10;



$displayofflinemodels=0;
$offlinemodelslines=4;
$paymentday=13;
$freechattime=66666120;
$moviequality=100;
$moviebandwith=12000;
?>

Here is main header file

<?php
include("dbase.php");
include("settings.php");
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title><? echo $sitename; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../styles.css" rel="stylesheet" type="text/css">

</head>

<body>
<TABLE width="720" BORDER="0" align="center" CELLPADDING="0" CELLSPACING="0" bgcolor="#333333">
  <TR>
    <TD width="730"><img src="../images/header.png" width="720" height="150">
      <table width="720" height="26" border="0">
        <tr>
          <td background="../images/links_bg.png" bgcolor="#000000"><div align="center" class="style2"><span class="style3"><a href="index.php" target="_self">Live Models</a> &nbsp;: : &nbsp;<a href="registration/user.php" target="_self">Member Signup</a> &nbsp;: : &nbsp;<a href="registration/model.php" target="_self">Model Signup</a>&nbsp;&nbsp;: : &nbsp;<a href="login.php" target="_self">Login</a></span></div></td>
        </tr>
      </table></TD>
  </TR>
</TABLE>

**Please HelP me.... **

Edited by Ezzaral: Code formatting.

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.