Originally posted by toshog
right. and i've also had it for a couple of years on my desktop. but i couldn't find scripting tutorials on the mysql site...
Does it have a reference section for you to refer to? Does it have an index?
Oh, all right. I'll look it up for you. Hang on, let me just find the online version, first...(clock starts:now - but my traffic load is pretty high at the moment so you'll have to bear with me)
http://www.mysql.com/ ....
Products: http://www.mysql.com/products/ ....
Database server: http://www.mysql.com/products/mysql/ ....
Online Documentation: http://dev.mysql.com/doc/mysql/en/index.html
2 minutes 36 seconds and I'm looking at the manual.
14.SQL Statement Syntax: http://dev.mysql.com/doc/mysql/en/SQL_Syntax.html
14.1.10 Update Syntax: http://dev.mysql.com/doc/mysql/en/UPDATE.html
4 minutes 38 seconds. Second paragraph.
Multiple-table syntax:
UPDATE [LOW_PRIORITY] [IGNORE] tbl_name [, tbl_name ...]
SET col_name1=expr1 [, col_name2=expr2 ...]
[WHERE where_definition]
5 minutes 3 seconds, a bit further down:
Starting with MySQL 4.0.4, you can also perform UPDATE operations that cover multiple tables:
UPDATE items,month SET items.price=month.price
WHERE items.id=month.id;
A minute later I found this in the user-contributed notes (which I guess aren't in your desktop copy):
Posted by Adam Boyle on March 2 2004 4:28pm
It took me a few minutes to figure this out, but the syntax for UPDATING ONE TABLE ONLY using a relationship between two tables in MySQL 4.0 is actually quite simple:
update t1, t2 set t1.field = t2.value where t1.this = t2.that;
What were you looking for, again?