I am currently trying to insert data into a table named "customer_quote" , this table acts as a link table between the table "customer" and the table "customer_tariffs" . It also records the user who transferred the data using the user table .
Here is the diagram of my db:
http://i.imgur.com/LOG1T.png

and here is a screenshot of a table that does not allow me to insert into it.
http://i.imgur.com/i2wiU.png

This is how I embed in my db:
- Paste the data into the customer table
- Get row id using mysql_insert_id
- Paste the data into customer_quote <--- Not working!
Here is the code:
$sustomer->cid = mysql_insert_id($db);
$database->query("INSERT INTO customer_quote (cid)
Values ('$customer->cid')");
** New error message **
'Unable to add or update child row: foreign key failed ( quote_system. customer_quote, CONSTRAINT fk_customer_quote_customerFOREIGN KEY ( cid) LINKS customer( id) ON DELETE NO ACTION ON UPDATE NO ACTION)'
As you can see, error feedback is useless, so after three hours of testing, I came to the conclusion that the problem is in my "cid" column in the "Client Quote" table.
It takes only certain values, however, my own php variable has the correct value, which is available for insertion through phpmyadmin, as you can see in the screenshot below.
http://i.imgur.com/eEFou.png

, - , ?
, .
!