Jump to content


Photo

OK, I need some help with the code on this webpage.


  • Please log in to reply
4 replies to this topic

#1 jdurden

jdurden
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 21 August 2006 - 02:45 PM

I 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.

Can somebody assist with this? please let me know what you need me to procide in order to assist me with this issue...

thanks,

J.

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 21 August 2006 - 02:53 PM

Either the database isn't identical or the code isn't, as the Press Releases aren't the same on both sites, but this maybe because the data in the Databases isn't the same.

Just figured if you'd missed that detail, you may have failed to mention something else.

Regards
Rich


Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 jdurden

jdurden
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 21 August 2006 - 03:13 PM

OK, I just deleted the table and copied the table over exactly from the main site and it didn't fix the issue. The errors I am getting refer to this particular line of code:

<?php } while ($row_rsNews = mysql_fetch_assoc($rsNews)); ?>

Does that help?

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 21 August 2006 - 03:32 PM

Do you mean this error that occurs with press.php?

Warning: mysql_fetch_assoc(): 11 is not a valid MySQL result resource in /home/mavetcom/public_html/press.php on line 80


Or do you mean the lack of information displayed after clicking a link on the left of your page, where NewsID is passed to pressdetail.php

In either case, or both, you'll need to post some of the relevant code otherwise this is going to be nothing but a guessing game.  One guess is that register_globals is OFF and you're expecting $NewsID to be available as a global variable.
Legend has it that reading the manual never killed anyone.
My site

#5 jdurden

jdurden
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 21 August 2006 - 03:49 PM

Yes, you are correct. 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"

Here is the PHP code for pressdetail.php:

<?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">&nbsp;</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">&nbsp;</td>
  </tr>
</table>
<table width="100%">
  <tr>
    <td height="100">&nbsp;</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">&nbsp;</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">&nbsp;</td>
								</tr>
								<tr>
									<td valign="top"><a href="../press.php">&laquo; Press Releases</a></td>
								</tr>
								<tr>
									<td class="bodystandard" valign="top">&nbsp;</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>

and the code for press.php:

<?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">&nbsp;</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">&nbsp;</td>
  </tr>
</table>
<table width="100%">
  <tr>
    <td height="100">&nbsp;</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">&nbsp;</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>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users