NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page MySQL won't let me delete rows

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 11-27-2010, 01:07 PM THREAD STARTER               #1 (permalink)
dkr
Respect My Authority!
Join Date: Jul 2005
Location: Canada
Posts: 2,234
dkr has a brilliant futuredkr has a brilliant futuredkr has a brilliant futuredkr has a brilliant futuredkr has a brilliant futuredkr has a brilliant futuredkr has a brilliant futuredkr has a brilliant futuredkr has a brilliant futuredkr has a brilliant futuredkr has a brilliant future
 



Save The Children Baby Health

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!
__________________
Follow Me (new!): @donnyouyang
Founder @ Rayku | Kinkarso Tech
dkr is offline   Reply With Quote
Old 11-27-2010, 02:01 PM   #2 (permalink)
Senior Member
 
Chicken's Avatar
Join Date: Oct 2005
Posts: 1,089
Chicken has much to be proud ofChicken has much to be proud ofChicken has much to be proud ofChicken has much to be proud ofChicken has much to be proud ofChicken has much to be proud ofChicken has much to be proud ofChicken has much to be proud ofChicken has much to be proud of
 


Save The Children Save The Children Save The Children Save The Children
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
Chicken is offline   Reply With Quote
Old 11-27-2010, 05:18 PM   #3 (permalink)
NamePros Member
Join Date: Nov 2003
Location: Ontario, Canada
Posts: 127
eagle12 will become famous soon enougheagle12 will become famous soon enough
 



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.
eagle12 is offline   Reply With Quote
Reply


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

 
All times are GMT -7. The time now is 02:40 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger