Jump to content

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/11296-php-mysql-sender-variable-problems/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.