Jump to content

Recommended Posts

I made a MySQL inbox for a game I'm making online... but I'm having some trouble.

 

<html>
<head>
<LINK href="style.css" rel="stylesheet" type="text/css">
<?php
$title="Inbox";
require("navtemp.inc");
require("serverinfo.inc");


if (isset($_COOKIE['userid']))
{
$username=$_COOKIE['username'];
echo "Welcome ".$username." to your inbox!";
echo "<a href='newPM.html' target='_blank'>Compose a new message</a>";
}
else
{
die("Your not logged in! Log in!");
}

$formset= <<<END
<form action='deletemsg.php' method='post'>
END;

$tablehead = <<<END
<table>
<tr border='1'><td>FROM</td><td>SUBJECT</td><td>CREATED</td><td>DELETE</td></tr>
END;

$tableend = "</table></div></body></html>";

echo $tablehead;
echo $formset;

$sql="SELECT pmid FROM myPM WHERE to='$username'";
$query=mysql_query($sql) or die(mysql_error());
$msg=mysql_fetch_assoc($query) or die(mysql_error());

foreach ($msg as $id)
{
$sql1="SELECT * FROM myPM WHERE pmid='$id'";
$query1=mysql_query($sql) or die(mysql_error());
$msg1=mysql_fetch_assoc($query) or die(mysql_error());
echo "<tr><td>".$msg1['from']."</td><td>".$msg1['title']."</td><td>".$msg1['pmdate']."</td><td><input type=checkbox name='".$msg1['pmid']."'>";
}

echo "<input type=submit value='Delete Messages'></form>";

echo $tableend;

?>

 

The only clue that SQL gives me that it's near somewhere near these lines:

 

$sql="SELECT pmid FROM myPM WHERE to='$username'";
$query=mysql_query($sql) or die(mysql_error());

 

Any ideas? Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/48547-solved-mysql-inbox-help/
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.