Support Forums - Classified Ads Script Osclass

General osclass questions => General discussion => Topic started by: Ahmed Abdelhamed on October 19, 2021, 06:47:35 PM

Title: about fk_i_item_id in oc_item_location
Post by: Ahmed Abdelhamed on October 19, 2021, 06:47:35 PM
how can i edit on phpmyadmin to give fk_i_item on table oc_item_location a    AUTO_INCREMENT option like pk_i_id on oc_t_item table

to take both the same number

when i try to edit it

appear to me this error

Cannot change column 'fk_i_item_id': used in a foreign key constraint 'oc_t_item_location_ibfk_1'

how can i solve this problem


thanks in advanced
Title: Re: about fk_i_item_id in oc_item_location
Post by: MB Themes on October 19, 2021, 08:42:48 PM
@Ahmed
That is foreign key protecting your tables. Not a problem, it is feature.
Title: Re: about fk_i_item_id in oc_item_location
Post by: Ahmed Abdelhamed on October 19, 2021, 08:48:08 PM
@MB Themes

i know sir that but when i upload content to oc_t_item it take pk_i_id automatic without i enter it but in oc_t_item_location it must to enter fk_i_item value manully and it will be hard for thousands of ads for that i need to know how to disable this feature to can make the field on oc_t_item take the fk_i_item auto like pk_i_id on oc_t_item
Title: Re: about fk_i_item_id in oc_item_location
Post by: MB Themes on October 19, 2021, 08:51:05 PM
@Ahmed
fk_i_item_id must match to something from t_item.pk_i_id, otherwise do not put there such value.
Title: Re: about fk_i_item_id in oc_item_location
Post by: Ahmed Abdelhamed on October 19, 2021, 09:01:11 PM
@ MB Themes

can i change these column

   fk_c_country_code   s_country   s_address   s_zip   fk_i_region_id   s_region   fk_i_city_id   s_city   fk_i_city_area_id   s_city_area   d_coord_lat   d_coord_long

that located on oc_t_item_location to oc_t_item table



and delete the column fk_i_item_id that located on oc_t_item_location and depend on pk_i_id rather than depend on it



is this possible or not ?
Title: Re: about fk_i_item_id in oc_item_location
Post by: MB Themes on October 19, 2021, 09:04:47 PM
I do not think you understand to concept of relational database :)
No it is not possible.