Reply to Re: How do I find out what foreign keys depend on this roy?

Your name:

Reply:


Posted by Andy Hassall on 07/25/06 16:50

On 25 Jul 2006 08:19:30 -0700, laredotornado@zipmail.com wrote:

>Hi, Using PHP 4, MySQL 4, I'm getting an error when executing an SQL
>statement:
>
>Statement failed "DELETE FROM USERS WHERE USER_ID = 17" - Cannot delete
>or update a parent row: a foreign key constraint fails
>
>How can I query the SQL database to figure out what parent row the
>statement is complaining about?

It seems the only way to list foreign keys in MySQL is using SHOW CREATE
TABLE, which doesn't help you much.

SHOW INNODB STATUS shows information on recent foreign key errors, but that'll
all be mixed together with other sessions.

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация