Date: 11/22/01
- Next message: george: "Re: [PHP-DB] Re: New to PHP and MySQL!!!"
- Previous message: Oli Wilkinson: "[PHP-DB] Re: New to PHP and MySQL!!!"
- In reply to: Andy: "[PHP-DB] Combination of SQL statements invalid in MySQL?"
- Next in thread: Fred: "[PHP-DB] Re: Combination of SQL statements invalid in MySQL?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 <email protected>
-----Original Message-----
From: Andy [mailto:news.letters <email protected>]
Sent: Thursday November 22, 2001 9:09 AM
To: php-db <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 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 <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: george: "Re: [PHP-DB] Re: New to PHP and MySQL!!!"
- Previous message: Oli Wilkinson: "[PHP-DB] Re: New to PHP and MySQL!!!"
- In reply to: Andy: "[PHP-DB] Combination of SQL statements invalid in MySQL?"
- Next in thread: Fred: "[PHP-DB] Re: Combination of SQL statements invalid in MySQL?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

