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> Link to comment https://forums.phpfreaks.com/topic/172288-in-game-pm-error/ 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 Link to comment https://forums.phpfreaks.com/topic/172288-in-game-pm-error/#findComment-908389 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? :/ Link to comment https://forums.phpfreaks.com/topic/172288-in-game-pm-error/#findComment-908418 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? Link to comment https://forums.phpfreaks.com/topic/172288-in-game-pm-error/#findComment-908439 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.