Results 1 to 21 of 21
Feb 9, 2002, 02:32 #1
- Join Date
- Feb 2002
- Prince George, BC
- 0 Post(s)
- 0 Thread(s)
Need help with update, set, order by, limit, in same query. I get "Syntax error"...
I'm a total newbie to forum, so please excuse any errors in ethics or such...but this little problem's got me puzzled!
The MySQL manual states:
...."UPDATE updates columns in existing table rows with new values. The SET clause indicates which columns to modify and the values they should be given. The WHERE clause, if given, specifies which rows should be updated. Otherwise all rows are updated. If the ORDER BY clause is specified, the rows will be updated in the order that is specified."......
...."In MySQL Version 3.23, you can use LIMIT # to ensure that only a given number of rows are changed."....
Then why pray-tell does this PHP query:
"update table_name set confirmed='Y' where category='value' and confirmed='N' order by date LIMIT 3;"
Produce this Notice:
"Query Failed: You have an error in your SQL syntax near 'order by date LIMIT 3 ' at line 1"....
I'm not completely new to php/mysql as I have designed a basic database site (thanks in great part to sitepoint's articles)... but man I could use a couple of hints to try out...