Re: [PHP] quert problems

2002-10-07 Thread Stuart Dallas

Kurth Bemis (List Monkey) wrote:

> what the hell i wrong in this query?
>
> $q = "UPDATE userpref WHERE username='kurth' AND 
> preference=required_hits SET preference=$HTTP_POST_VARS[required_hits]";
>
> mysql_error() returns this...You have an error in your SQL syntax near 
> 'WHERE username='kurth' AND preference=required_hits SET preference=5' 
> at line 1
>
> what gives?

1) This is a PHP list, not an SQL help list

2) The SET clause goes before the WHERE clause

-- 
Stuart



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] quert problems

2002-10-07 Thread Phillip Erskine

"SET" comes before "WHERE"

$q = "UPDATE userpref SET preference=$HTTP_POST_VARS[required_hits] WHERE 
username='kurth' AND preference=required_hits";


_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] quert problems

2002-10-07 Thread Kurth Bemis (List Monkey)

what the hell i wrong in this query?

$q = "UPDATE userpref WHERE username='kurth' AND preference=required_hits 
SET preference=$HTTP_POST_VARS[required_hits]";

mysql_error() returns this...You have an error in your SQL syntax near 
'WHERE username='kurth' AND preference=required_hits SET preference=5' at 
line 1

what gives?

~kurth


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php