| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Respect My Authority! Join Date: Jul 2005 Location: Canada
Posts: 2,234
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | MySQL won't let me delete rows Hi there, I am trying to clean out my database by deleting entries in certain tables. However, I am constantly getting a MySQL error message saying that I can't do so. Is there any way I can work around this? #1451 - Cannot delete or update a parent row: a foreign key constraint fails (`rayku_db`.`shout`, CONSTRAINT `shout_ibfk_1` FOREIGN KEY (`poster_id`) REFERENCES `user` (`id`)) ![]() Thanks! |
| | |
| | #2 (permalink) |
| Senior Member Join Date: Oct 2005
Posts: 1,089
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Have you tried looking at stackoverflow? Seems to be the same problem as you. http://stackoverflow.com/questions/1...nstraint-fails
__________________ Quit developing - Jan 2012 |
| | |
| | #3 (permalink) |
| NamePros Member Join Date: Nov 2003 Location: Ontario, Canada
Posts: 127
![]() ![]() | It is because that record relates to another record. Chances are, that is tables records is the one in a one-to-many relationship. This means that you need to delete the records on the many side first. Then you can delete the record you are trying to delete. |
| | |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need to delete duplicate entries in mysql | dubya | Programming | 4 | 11-04-2009 02:35 AM |
| Cpanel downgrade MYSQL 4.1.X to MySQL 4.0.xx | Webhosting-live.com | Web Hosting Discussion | 3 | 09-01-2006 05:12 PM |
| Tutorial: How to Install Apache2 MySQL and PHP on Windows | deadserious | Webmaster Tutorials | 35 | 09-21-2005 09:46 PM |