does PHP support foreign key and Rollback?yes or not.if not
then why. how will you done these concept in php?



does PHP support foreign key and Rollback?yes or not.if not then why. how will you done these conce..

Answer / praveen

PHP supports Foreign Keys in InnoDB Storage Engine in
version and above 4.0. It checks the foreign key referential
integrities on Delete and Select statements. If you strictly
needed the foreign keys and speed is not a concern then you
can create table structures using InnoDB Storage Engine.


Where as MyISAM Storage Engines does not allow foreign key
concept. But it will parse the table that contains foreign
keys but wont check the referential integreties. So it is
the job of the designer/programmer to check the desired key
and its dependency in multiple tables.

Let us suppose you have a field F1(primary)in Table1 and
this field is referenced in another tables denoted as (F2,
F3) in tables Table2, Table3......(as a foreign key)

and when you want to perform a DELETE operation/query based
on field F1, then
First you need to write a query to Delete the specified row
in Table1
and you also need to write a query to Delete all
dependent/referenced rows in other tables Table2, Table3...

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More PHP Interview Questions

i m a B.E,passed out few yrs bak failed to find good job due to less marks now thinkin of a career as PHP developer. is it a lucarative field and wat r career prospects; hv heard dat initial salary is very less bout 6k also most jobs r contrct jobs.pls guide me need ur valuable advice.pls hellppp!! thnx..

0 Answers   MNC,


What are the core OOP’s concepts?

2 Answers  


What is a php certification?

0 Answers  


how to register website in internet

2 Answers  


Tell me how to get the value of current session id?

0 Answers  






What is an operator in php?

0 Answers  


what is the diffrence between for and foreach?

11 Answers   Hirolasoft, IBM, Photon,


How do you destroy a session?

0 Answers  


Explain whether it is possible to share a single instance of a memcache between multiple php projects?

0 Answers  


which function used to get the file name in php?

5 Answers  


How to find the index of an element in an array php?

0 Answers  


what method is used to generate a random number?

4 Answers  


Categories