Re: PHP/MySQL help?
| From: | Steven M | Date: | Mon, 13 Jan 2003 00:03:38 +0000 |
| Subject: | Re: PHP/MySQL help? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131371@lists.php.net to get a copy of this message | ||
I thought i read somewhere that you could refer to the field by number. Was
i wrong? It doesn't seem to make a difference anyway. It still doesn't
work. Here's the code with words instead of numbers. I'd be grateful if
you could let me know if there are any obvious errors.
Best wishes.
Steven M
include 'db.php';
$result = mysql_query("SELECT newtest FROM users WHERE newtest = '$0'");
list($number) = mysql_fetch_row($result);
if($number==0)
{mysql_query("UPDATE users SET points = '$+2' WHERE newtest = '$0'");
mysql_query("UPDATE users SET newtest = '$1' WHERE newtest = '$0'");
header("Location: redirect1.php");
}
elseif($number==1)
{
header("Location: redirect2.php");
}
else
{
header("Location: error.php");
}