rae_rae
-
Posts
2 -
Joined
-
Last visited
Never
Posts posted by rae_rae
-
-
Here is my code:
<?
include ("../_includes/dbconn.php");
include ("../_includes/footer.php");
include ("../_includes/whoisonline.php");
include ("header.php");
// Main page content
make_header();
db_connect();
// Section Retrieval------------------------------------------------------------------------
echo '<hr>';
echo "<span style='font-size: 11px; font-weight: bold'>{$_GET['section_name']}</span><br><br>";
$displ_query = "SELECT * FROM content_ WHERE section_name='{$_GET['section_name']}'";
$result = mysql_query($displ_query);
for ($i = 0; $i < mysql_numrows($result); $i++)
{
$content_id = mysql_result($result, $i, 'content_id');
$content_name = mysql_result($result, $i, 'content_name');
$content_body = mysql_result($result, $i, 'content_body');
$content_date = mysql_result($result, $i, 'content_date');
print"<a href=\"_main.php?sender=displ_body_qry&content_id=$content_id\" style=\"color: #FFFFFF\">$content_name</a><br />";
}
mysql_close();
exit();
// End Data----------------------------------------------------------------------------------
switch($_REQUEST['sender']){
case displ_body_qry:
db_connect();
$displ_query = "SELECT * FROM content_ WHERE content_id='{$_GET['content_id']}'";
$result = mysql_query($displ_query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$content_body = $row['content_body'];
echo $content_body;
echo '<span class="style2"><a href="#Root"><img src="../_images/icon_totop.gif" border="0" alt="Back to top"></img></a></span><br><hr>';
}
mysql_close();
exit();
break;
}
make_footer();
?>
The problem is with the line: $displ_query = "SELECT * FROM content_ WHERE content_id='{$_GET['content_id']}'";
The ($_REQUEST['sender']) is apparently not sending the right variable or something...this same approach works just fine throughout the rest of my code...I have NO idea why this is happening...
Help is appreciated.
PHP / MySQL sender variable problems
in PHP Coding Help
Posted