RE: [PHP-DB] Combination of SQL statements invalid in MySQL?
| From: | Matt Friedman | Date: | Thu, 22 Nov 2001 16:34:49 +0000 |
| Subject: | RE: [PHP-DB] Combination of SQL statements invalid in MySQL? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14535@lists.php.net to get a copy of this message | ||
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: matt@SpryNewMedia.com
-----Original Message-----
From: Andy [mailto:news.letters@gmx.de]
Sent: Thursday November 22, 2001 9:09 AM
To: php-db@lists.php.net
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 bóok. 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: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net