You can't use numbers as vars: $1 etc are illegal syntax for PHP
Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -----Original Message----- > From: Steven M [mailto:[EMAIL PROTECTED]] > Sent: Monday, 13 January 2003 10:04 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] PHP/MySQL help? > > > 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"); > } > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php