The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
$query = "SELECT memberPass FROM member WHERE memberName = '$userentry'";
$result = mysql_query($query)
or die("SYerror 03 : Could Not Execute Query");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
extract($row);
switch ($memberPass)
The problem is, when a log in fails, a warning appears :
Warning: extract(): First argument should be an array in...
Need to get rid of it, somehow. Any ideas?
> What is the is_array thing? What does it do exactly?
Its just a built in php function that checks whether the variable you pass to it is an array or not. Check http://www.php.net/is_array if you want to know more.
What is the is_array thing? What does it do exactly?
Several solutions I guess, something like:
if (is_array($row)) {
extract($row);
} else {
// if row isn't an array then init the vars to something so they make
// some sense to later code.
$memberPass="";
}
That should fix your error. Its not the best solution, but it works hopefully.
$query = "SELECT memberPass FROM member WHERE memberName = '$userentry'";
$result = mysql_query($query)
or die("SYerror 03 : Could Not Execute Query");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
extract($row);
switch ($memberPass)
The problem is, when a log in fails, a warning appears :
Warning: extract(): First argument should be an array in...
Need to get rid of it, somehow. Any ideas?