IF语句导致500内部服务器错误

The IF statement below causes a 500 error. The page loads fine when I remove the IF statement.

If there anything wrong with it?

$oldtweets = mysql_query("SELECT submissionid, loginid FROM tweets WHERE submissionid = '$submissionid' AND loginid = '$loginid'");

if (mysql_num_rows($oldtweets) = 0)
{
 mysql_query("INSERT INTO tweets VALUES (NULL, '$city', '$submissionid', '$fullurl', '$uid', '$username', NULL)");
}

First thing I would look at is this -

if (mysql_num_rows($oldtweets) = 0)

Should be this -

if (mysql_num_rows($oldtweets) == 0)

You are using a single =, which is the assignment operator. You should be using ==, the comparison operator.