As far as I know sub-selects are not supported in mysql.

You have to make a list of item ids first and then use that list in your
delete statement.

ie: WHERE userid IN (list_goes_here)

Matt Friedman
Web Applications Developer
www.SpryNewMedia.com
Email: [EMAIL PROTECTED]
 


-----Original Message-----
From: Andy [mailto:[EMAIL PROTECTED]] 
Sent: Thursday November 22, 2001 9:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Combination of SQL statements invalid in MySQL?


Hi there,

I am trying to do a combination of SQL statements like described in a
SQL bok. Is it possible, that mysql does not allow this syntax?

Thanx Andy

Error:

Occured during executing DELETE FROM test_user_interests WHERE user_id =
(SELECT user_id FROM test_user WHERE user_name = 'herbert01') statement

Error: 1064 You have an error in your SQL syntax near 'SELECT user_id
FROM test_user WHERE user_name = 'herbert01') ' at line 3



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to