|
Posted by jdurden on 08/21/06 18:40
am currently woking on building this site: www.maverick-spirit.com.
everything seems to be fine except the press releases page. When you
click on one of the press releases in the left column under the menu,
nothing comes up. I copied the code for the page directly from the
press releases page on our main site: www.maverickentertainment.cc, and
it is using an identical database, so I am unsure what is wrong.
The issue happens when you click one of the press releases in the left
column. The pressdetail.php page should open up with the text of the
press release. Instead, it is just blank. Then, when you click "Press
Releases", it should go to the page press.php. The following error
occurs when trying to access press.php: "Warning: mysql_fetch_assoc():
11 is not a valid MySQL result resource in
/home/mavetcom/public_html/press.php on line 80"
This is the line in question:
<?php } while ($row_rsNews = mysql_fetch_assoc($rsNews)); ?>
Here is the PHP code for pressdetail.php:
[code]<?php require('Connections/connDatabase.php'); ?>
<?php
$colname_rsNews = "1";
if (isset($HTTP_GET_VARS['NewsID'])) {
$colname_rsNews = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['NewsID']
: addslashes($HTTP_GET_VARS['NewsID']);
}
mysql_select_db($database_connDatabase, $connDatabase);
$query_rsNews = sprintf("SELECT NewsID, NewsName, NewsDate, NewsShort,
NewsFull FROM News", $colname_rsNews);
$rsNews = mysql_query($query_rsNews, $connDatabase) or
die(mysql_error());
$row_rsNews = mysql_fetch_assoc($rsNews);
$totalRows_rsNews = mysql_num_rows($rsNews);
require('includes/configure.php'); ?>
<html><!-- InstanceBegin template="/Templates/pagelayout2003.dwt.php"
codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title><?php echo substr($row_rsNews['NewsShort'], 0, 50);
?>...</title>
<meta name="description" content="<?php echo $row_rsNews['NewsShort'];
?>">
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<meta name="keywords" content="Maverick Entertainment, Maverick Home
Video, Doug Schwab, Urban Film Distribution, Urban Film Production,
Urban Films, Urban Movies, gangsta movies, a miami tail, african
american movies, Afro-American Movies, American Black Film Festival,
black african american movies, Black Cinema, black film festivals,
Black Films, Blockbuster Distribution, blockbuster video, dvd movies,
eva longoria, film distribution, film makers, film production
companies, hip hop movies, hollywood black film festival, independent
film festivals, independent film production, independent films, latino
actresses, latino movies, Maverick Pictures, movie production
companies, rapper trina, Rappers in Movies, trina the rapper">
<link href="styles.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable
--><!-- InstanceParam name="onload" type="text" value="" -->
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0"
background="../images/headerbg.jpg" style="border-bottom:1px solid
#cccccc;">
<tr>
<td height="75"> </td>
<td width="580" height="75" align="right" valign="bottom"><img
src="../images/division.gif" width="273" height="20"
style="margin-bottom:5px; margin-right:10px;"></td>
<td height="75"> </td>
</tr>
</table>
<table width="100%">
<tr>
<td height="100"> </td>
<td width="5000" height="100" align="center" valign="middle"><div
style="position:relative;top:7px"><img src="../images/spirit.jpg"
width="760" height="100" class="pictureframe"></td>
<td height="100"> </td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0"
cellspacing="0" style="margin-top:15px;">
<tr align="left" valign="top">
<td width="180">
<?php include(DIR_INCLUDES . 'leftcol.php'); ?>
<!-- InstanceBeginEditable name="leftcol" --><!-- InstanceEndEditable
--></td>
<td width="10"><img src="../images/spacer.gif" width="10"
height="10"></td>
<td class="contentarea"><!-- InstanceBeginEditable name="content"
-->
<h1><img src="images/spiritpress.jpg" alt="" height="81"
width="536" border="0"></h1>
<table width="380" border="0" cellspacing="4" cellpadding="0"
align="center">
<tr>
<td valign="top"> </td>
</tr>
<tr>
<td valign="top"><a href="../press.php">« Press
Releases</a></td>
</tr>
<tr>
<td class="bodystandard" valign="top"> </td>
</tr>
<tr>
<td class="bodystandard" valign="top"><?php echo
$row_rsNews['NewsFull']; ?></td>
</tr>
<tr>
<td valign="top"><img src="../images/spacer10x10.gif"
height="18" width="100%"></td>
</tr>
</table>
<div>
<em><font
color="#996699"></font></em></div> </td></tr></tbody></td></tr></tbody></table>
<table class="bottomtable" cellspacing="0" cellpadding="5" width="650"
align="center" bgcolor="#ffffff" border="0">
<tbody>
<tr>
<td valign="top" align="center">
<p align="center" class="footer">
<?php include(DIR_INCLUDES . 'footer.php'); ?>
</p>
</body>
<!-- InstanceEnd --></html>[/code]
and the code for press.php:
[code]<?php require_once('Connections/connDatabase.php'); ?>
<?php require('includes/configure.php'); ?>
<?php
mysql_select_db($database_connDatabase, $connDatabase);
$query_rsNews = "SELECT SQL_CACHE NewsCategory, NewsID, NewsName,
NewsDate, NewsShort, NewsActive FROM News WHERE NewsCategory = 1 AND
NewsActive = 'Yes' ORDER BY NewsDate DESC LIMIT 5";
$rsNews = mysql_query($query_rsNews, $connDatabase) or
die(mysql_error());
$row_rsNews = mysql_fetch_assoc($rsNews);
$totalRows_rsNews = mysql_num_rows($rsNews);
mysql_select_db($database_connDatabase, $connDatabase);
$query_rsPressReleases = "SELECT SQL_CACHE NewsCategory, NewsID,
NewsDate, NewsShort, NewsActive FROM News WHERE NewsCategory = 2 AND
NewsActive = 'Yes' ORDER BY NewsDate DESC LIMIT 5";
$rsPressReleases = mysql_query($query_rsPressReleases, $connDatabase)
or die(mysql_error());
$row_rsPressReleases = mysql_fetch_assoc($rsPressReleases);
$totalRows_rsPressReleases = mysql_num_rows($rsPressReleases);
mysql_select_db($database_connDatabase, $connDatabase);
$query_rsAdvisories = "SELECT SQL_CACHE NewsCategory, NewsID, NewsDate,
NewsShort, NewsActive FROM News WHERE NewsCategory = 3 AND NewsActive =
'Yes' ORDER BY NewsDate DESC LIMIT 5";
$rsAdvisories = mysql_query($query_rsAdvisories, $connDatabase) or
die(mysql_error());
$row_rsAdvisories = mysql_fetch_assoc($rsAdvisories);
$totalRows_rsAdvisories = mysql_num_rows($rsAdvisories);
?>
<html><!-- InstanceBegin template="/Templates/pagelayout2003.dwt.php"
codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title><?php echo substr($row_rsNews['NewsShort'], 0, 50);
?>...</title>
<meta name="description" content="<?php echo $row_rsNews['NewsShort'];
?>">
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<meta name="keywords" content="Maverick Entertainment, Maverick Home
Video, Doug Schwab, Urban Film Distribution, Urban Film Production,
Urban Films, Urban Movies, gangsta movies, a miami tail, african
american movies, Afro-American Movies, American Black Film Festival,
black african american movies, Black Cinema, black film festivals,
Black Films, Blockbuster Distribution, blockbuster video, dvd movies,
eva longoria, film distribution, film makers, film production
companies, hip hop movies, hollywood black film festival, independent
film festivals, independent film production, independent films, latino
actresses, latino movies, Maverick Pictures, movie production
companies, rapper trina, Rappers in Movies, trina the rapper">
<link href="styles.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable
--><!-- InstanceParam name="onload" type="text" value="" -->
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0"
background="../images/headerbg.jpg" style="border-bottom:1px solid
#cccccc;">
<tr>
<td height="75"> </td>
<td width="580" height="75" align="right" valign="bottom"><img
src="../images/division.gif" width="273" height="20"
style="margin-bottom:5px; margin-right:10px;"></td>
<td height="75"> </td>
</tr>
</table>
<table width="100%">
<tr>
<td height="100"> </td>
<td width="5000" height="100" align="center" valign="middle"><div
style="position:relative;top:7px"><img src="../images/spirit.jpg"
width="760" height="100" class="pictureframe"></td>
<td height="100"> </td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0"
cellspacing="0" style="margin-top:15px;">
<tr align="left" valign="top">
<td width="180">
<?php include(DIR_INCLUDES . 'leftcol.php'); ?>
<!-- InstanceBeginEditable name="leftcol" --><!-- InstanceEndEditable
--></td>
<td width="10"><img src="../images/spacer.gif" width="10"
height="10"></td>
<td class="contentarea"><!-- InstanceBeginEditable name="content"
-->
<h1><img src="images/spiritpress.jpg" alt="" height="81"
width="536" border="0"></h1>
<table width="380" border="0" align="center" cellpadding="0"
cellspacing="4">
<tr>
<td valign="top"> </td>
</tr>
<?php if ($totalRows_rsNews > 0) { // Show if recordset not
empty ?>
<tr>
<td valign="top" class="bodybold">In The News <span
class="bodysmall">[ <a href="press_archive.php?NewsCategoryID=1">View
Archive for more stories</a> ]</span></td>
</tr>
<tr>
<td valign="top" class="bodybold"> </td>
</tr>
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<?php do { ?>
<tr align="left" valign="baseline">
<td width="80" valign="top"><img src="images/icon_doc.gif"
width="10" height="10"> <?php echo DoDateTime( $row_rsNews['NewsDate'],
'm/d/y'); ?> :</td>
<td valign="top"><a href="pressdetail.php?NewsID=<?php echo
$row_rsNews['NewsID']; ?>"><?php echo $row_rsNews['NewsShort']; ?>
....</a></td>
</tr>
<tr align="left" valign="baseline">
<td height="10" colspan="2" valign="top"><img
src="images/spacer10x10.gif" width="10" height="10"></td>
</tr>
<?php } while ($row_rsNews = mysql_fetch_assoc($rsNews)); ?>
</table>
</td>
</tr>
<?php } // Show if recordset not empty ?><?php if
($totalRows_rsPressReleases > 0) { // Show if recordset not empty ?>
<tr>
<td valign="top" class="bodybold"> </td>
</tr>
<tr>
<td valign="top" class="bodybold">Press Releases <span
class="bodysmall">[ <a href="press_archive.php?NewsCategoryID=2">View
Archive for more stories</a> ]</span></td>
</tr>
<tr>
<td valign="top" class="bodybold"> </td>
</tr>
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<?php do { ?>
<tr align="left" valign="baseline">
<td width="80" valign="top"><img src="images/icon_doc.gif"
width="10" height="10"> <?php echo DoDateTime(
$row_rsPressReleases['NewsDate'], 'm/d/y'); ?> :</td>
<td valign="top"><a href="pressdetail.php?NewsID=<?php echo
$row_rsPressReleases['NewsID']; ?>"><?php echo
$row_rsPressReleases['NewsShort']; ?> ...</a></td>
</tr>
<tr align="left" valign="baseline">
<td height="10" colspan="2" valign="top"><img
src="images/spacer10x10.gif" width="10" height="10"></td>
</tr>
<?php } while ($row_rsPressReleases =
mysql_fetch_assoc($rsPressReleases)); ?>
</table>
</td>
</tr>
<?php } // Show if recordset not empty ?><?php if
($totalRows_rsAdvisories > 0) { // Show if recordset not empty ?>
<tr>
<td valign="top" class="bodybold"> </td>
</tr>
<tr>
<td valign="top" class="bodybold">Media Advisories <span
class="bodysmall">[ <a href="press_archive.php?NewsCategoryID=3">View
Archive for more stories</a> ]</span></td>
</tr>
<tr>
<td valign="top" class="bodybold"> </td>
</tr>
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<?php do { ?>
<tr align="left" valign="baseline">
<td width="80" valign="top"><img src="images/icon_doc.gif"
width="10" height="10"> <?php echo DoDateTime(
$row_rsAdvisories['NewsDate'], 'm/d/y'); ?> :</td>
<td valign="top"><a href="pressdetail.php?NewsID=<?php echo
$row_rsAdvisories['NewsID']; ?>"><?php echo
$row_rsAdvisories['NewsShort']; ?> ...</a></td>
</tr>
<tr align="left" valign="baseline">
<td height="10" colspan="2" valign="top"><img
src="images/spacer10x10.gif" width="10" height="10"></td>
</tr>
<?php } while ($row_rsAdvisories =
mysql_fetch_assoc($rsAdvisories)); ?>
</table>
</td>
</tr>
<?php } // Show if recordset not empty ?>
<tr>
<td valign="top"><img src="images/spacer10x10.gif"
width="100%" height="18"></td>
</tr>
</table>
<div>
<em><font color="#996699"></font></em></div>
</td></tr></tbody></td></tr></tbody></table>
<table class="bottomtable" cellspacing="0" cellpadding="5" width="650"
align="center" bgcolor="#ffffff" border="0">
<tbody>
<tr>
<td valign="top" align="center">
<p align="center" class="footer">
<?php include(DIR_INCLUDES . 'footer.php'); ?>
</p>
</body>
<!-- InstanceEnd --></html>[/code]
[Back to original message]
|