On Friday, April 5, 2002, at 01:58  PM, Phil Schwarzmann wrote:

> Is this query legal....?
>
> $query = "UPDATE table SET (var1, var2, var3) VALUES ($var1, $var2,
> $var3) WHERE username='$username'";

No.  The SET modifier (or whatever that is) can only be used to create 
column name/value relationship pairs.  To my knowledge, your syntax 
above (which looks similar to INSERT INTO table (..., ..., ...) 
VALUES (..., ..., ...)) cannot be used for UPDATE statements.

> Im wondering cause I have an INSERT query....
>
> $query = "INSERT INTO table (var1, var2, var3) VALUES ($var1, $var2,
> $var)";
>
> ...but only there are like 150 different variables and it will take me
> forever to write a query like....
>
> $query = "UPDATED table SET var1='$var1', var2='$var2', var3='$var3'
> WHERE username='$username'";

If you have shell access to your database server, you can always CREATE 
TEMPORARY TABLE and test things out on a small scale, then DROP TABLE 
when you're done playing.


Erik





----

Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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

Reply via email to