I am relatively new in php and mysql.The problem that i am facing while i inserting value in my leave
table.My leave
table containing following co
A foreign key constraint means that you one table doesn't accept inserts, updates or deletes that would 'break' the foreign key. This means, you can't update a EmpID if the new EmpID doesn't exist in the users. You can't add a new EmpID if it doesn't exist in the users table, etcetera. So to solve this issue, you need to make sure that the EmpID you're trying to add to table 'leave', first exists in table 'users'. Foreign keys can be a real powerful item, but can be a real pain too. Since the DB you're working on had foreign key constraints, I suggest you read on them a bit: http://en.wikipedia.org/wiki/Foreign_key