Thanks, I Applied Zurevs advice:
function getcomment($user,$id)
{
$con = mysql_connect("localhost","jameswit","Jordan");
if (!$con)
{
echo "Could not connect.";
}
$lols = mysql_select_db("jameswit_starship", $con);
if (!$lols)
{
echo "Could not select database.";
}
$result = mysql_query("SELECT * FROM ".$user."Crew WHERE id = ".$id);
if (!$result)
{
echo "No result <BR>";
echo "SELECT * FROM ".$user."Crew";
}
while($row = mysql_fetch_array($result))
{
if ((int)$row['loyalty']<20)
{
if ($row['rank']=="XO")
{
return $row['Name']." is openly mutinous towards you - s/he is not suitable as an XO.";
goto endsub;
}
else
{
return $row['Name']." is unhappy with your leadership.";
goto endsub;
}
}
}
endsub:
mysql_close($con);
}
The Quotes were left because PHP was looking for a variable called '$userCrew' when I removed the dots, and I need to words joined with no space between them. The thing with the equals signs was just my inexperience with this language. Thanks for pointing that out.
I'm still getting the same error. 'Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/jameswit/www/www/MYSQL.php on line 106'