Jump to content


Photo

PHP / MySQL sender variable problems


  • Please log in to reply
1 reply to this topic

#1 rae_rae

rae_rae
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 June 2006 - 03:56 AM

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.

#2 rae_rae

rae_rae
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 June 2006 - 04:17 AM

Lol, nm, I got it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users