Jump to content

[SOLVED] MySQL Inbox help


jaku78

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.