Hooo Posted August 28, 2009 Share Posted August 28, 2009 Basically, the code I will paste is the read message link. What happens is the message sends perfectly, however when clicking on the actual title the page (Below) doesn't actually show what it is supposed to, this being the message title, message contents etc. <html> <body> <?php include 'config.php'; include 'opendb.php'; session_start(); $userfinal=$_SESSION['usname']; $messageid = $_GET['message']; $message = mysql_query("SELECT * FROM `messages` WHERE `message_id` = '{$messageid}' AND `to_user` = '{$userfinal}'") or die(mysql_error()); $message=mysql_fetch_assoc($message); echo "<h1>Title: ".$message['message_title']."</h1><br><br>"; echo "<h3>From: ".$message['from_user']."<br><br></h3>"; echo "<h3>Message: <br>".$message['message_contents']."<br></h3>"; echo '<form name="backfrm" method="post" action="inbox.php">'; echo '<input type="submit" value="Back to Inbox">'; echo '</form>'; ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
ReKoNiZe Posted August 28, 2009 Share Posted August 28, 2009 Issue is right here: $message=mysql_fetch_assoc($message); You're assigning a variable to itself. Change the variable to like $MessageReceived=mysql_fetch_assoc($message); and update the rest of your variables Quote Link to comment Share on other sites More sharing options...
Hooo Posted August 28, 2009 Author Share Posted August 28, 2009 <html> <body> <?php include 'config.php'; include 'opendb.php'; session_start(); $userfinal=$_SESSION['usname']; $messageid = $_GET['message']; $message = mysql_query("SELECT * FROM `messages` WHERE `message_id` = '{$messageid}' AND `to_user` = '{$userfinal}'") or die(mysql_error()); $MessageRecieved=mysql_fetch_assoc($message); echo "<h1>Title: ".$MessageRecieved['message_title']."</h1><br><br>"; echo "<h3>From: ".$MessageRecieved['from_user']."<br><br></h3>"; echo "<h3>Message: <br>".$MessageRecieved['message_contents']."<br></h3>"; echo '<form name="backfrm" method="post" action="inbox.php">'; echo '<input type="submit" value="Back to Inbox">'; echo '</form>'; ?> </body> </html> No luck, did I miss something? :/ Quote Link to comment Share on other sites More sharing options...
ReKoNiZe Posted August 28, 2009 Share Posted August 28, 2009 Have you ran your query in phpMyAdmin or on the database at all to make sure you are receiving data? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.