Mysql foreign key doesn't allow update
Hi,
I have two mysql tables whose structures are defined using the following sql statements: PHP Code:
PHP Code:
However, when I want to update the same table, it gives me the same error with no changes on the table. I tried different combinations of on delte and on update actions, but I cannot get rid of this error. I also made sure that referred all referred columns have exact same type and length as foreign keys. Any idea what's going on here? Thanks in advance. |
I just tried to exact same query from mysql terminal, and i was able to do it. Then I tried to update the value of match_id to a value that is not available in matchResult, and it didn't allow me to execute the query correctly.
I think my problem is with my php application. |
get php to print out the exact query that is being executed. You may find that a variable is not set up as it should be
|
Thank you. I found out what the problem was. This query was executing inside the loop. The loop was supposed to continue n/2 times, but in my loop I had written n times. That's why, after (n/2)+1 times, it was trying to insert null values in the tables.
|
All times are GMT -5. The time now is 04:54 AM. |