Hi,
I have no idea what I am doing wrong here, there may be several mistakes in this code, the current error - unexpected T_RETURN is showing up at this line: while ($row = mysql_fetch_array($result)).
I would greatly appreciate any help as I can not find the mistake myself and have looked at my screen for hours trying to work it out, I'm also trying something with the if...else if, which may not be working.
The code is:
<?php
$con = mysql_connect("localhost","user","password");
if (!$con)
{
die(mysql_error());
}
mysql_select_db("mydb", $con);
if
(
$result = mysql_query("SELECT COUNT(*) FROM guests
WHERE email='username' AND password='password'")
while ($row = mysql_fetch_array($result))
{if ($result==1)})
{
return true;
}
elseif
{
$queryString = $_SERVER['QUERY_STRING'];
if
(
$query = "SELECT * FROM tempguests
WHERE activationKey=$queryString AND temppword=$password";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result))
{
if ($queryString ==$row['activationkey'])
{
$sql=UPDATE tempusers SET temppassword = ''
WHERE (tempuserID=$row[tempID])";return true;
}
}
)
{
return true;
}
else if
(
$query = "SELECT * FROM tempguests";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result))
{
if ($queryString ==$row['activationkey'])
{
$sql=UPDATE tempguests SET activationkey = '', status='activated'
WHERE (tempID=$row[tempID])";
}
{
$result = mysql_query("SELECT * FROM tempguests
WHERE email='$_GET['user']' ");
while ($row = mysql_fetch_array($result))
echo "<form action='insertguests.php' method='post'>"
fname=$row['fname'];
lname=$row['lname'];
email=$row['email'];
pword=$row['password'];
</form>";
}
{
return true;
}
}
)
{
return true;
}
}
else
{
echo "You are not registered."; return false;
}
mysql_close($con);
?>