PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$username = mysql_real_escape_string($_GET['user']);
$mail = mysql_real_escape_string($_GET['mail']);
$query = "SELECT * FROM pm WHERE user='$username' AND WHERE id='$mail'";
$result = mysql_query($query) or die(mysql_error());
You have a syntax error.. As you notice yourself when you visit the page:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id='0'' at line 1
Should be WHERE id='0' , thus in a string becomes "WHERE id='0'"
MySQL cannot handle multiple WHERE keywords, so once it sees the second WHERE it bails out. That's why it says the error is over there. Learn how to interpret error messages: it does the body good.