Support Forums - Classified Ads Script Osclass

General osclass questions => General discussion => Topic started by: Ahmed Abdelhamed on October 19, 2021, 03:03:43 AM

Title: about os class database
Post by: Ahmed Abdelhamed on October 19, 2021, 03:03:43 AM
i try to upload a csv file exported from db browser i filled with the content to upload it on oc_t_item table but i got this error in phpmyadmin please can u tell me how solve this problem thanks in advanced


#1452 - Cannot add or update a child row: a foreign key constraint fails (`osa`.`oc_t_item`, CONSTRAINT `oc_t_item_ibfk_1` FOREIGN KEY (`fk_i_user_id`) REFERENCES `oc_t_user` (`pk_i_id`))


Title: Re: about os class database
Post by: MB Themes on October 19, 2021, 09:32:30 AM
@Ahmed
fk_i_user_id has foreign key to t_user table, so you provide NULL here or value must be present in t_user.pk_i_id.
You may also disable foreign key check before upload.
Title: Re: about os class database
Post by: Ahmed Abdelhamed on October 19, 2021, 12:38:57 PM
@ MB Themes

please sir can i know how to disable foreign key check to the  t_user table
Title: Re: about os class database
Post by: mwindey on October 19, 2021, 02:19:16 PM
@Ahmed

Other options: in phpmyadmin
  Enable foreign key field checking
Uncheck the box in phpmyadmin when you upload the file
Title: Re: about os class database
Post by: Ahmed Abdelhamed on October 19, 2021, 03:27:11 PM
@ mwindey

thanks sir