I have always been the type to try and figure everything out on my own no matter the endeavor but I've tried so many things on this and can't get past this error. So here I am. Might become a regular should I continue enduring an uphill battle.
I am receiving "Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in ***.php on line 12
Also, I know there is a more streamlined method to accomplish what I am doing (that is, less lines of code) but since I am looping on this error I just broke it down into baby steps. I may also be way off when it gets down to the 'if' statement, not sure if I actually need to include an 'else' after it but that still should not cause me to get the error on the line indicated...
<?php
$con = mysql_connect("localhost","user","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db_name", $con);
$query = mysql_query("SELECT * FROM newaccount WHERE UName='""'");
$result = mysql_query($query);
if (!$result)
{
mysql_query("DROP TABLE newaccount");
mysql_close($con);
header("Location: http://whatever.html");
}
echo "All information needs to be provided in order to register. Please go back and submit the registration form again.";
mysql_query("DROP TABLE newaccount");
mysql_close($con);
?>