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

Is server side a session?

0 Answers  


code to see the priview of the image which is being uploaded (after browising the image... just click priview ... how it will be visible...before uploading)

0 Answers   Satyam,


How long do php sessions last?

0 Answers  


Explain some of the php string functions?

0 Answers  


What are sql functions?

0 Answers  






What are the common uses of php?

0 Answers  


What are php strings?

0 Answers  


How many escape sequences are recognized in double-quoted strings?

0 Answers  


what is the default session expire time in php? what is default file attachment size in mail in php?

3 Answers  


What are the differences between GET and POST methods in form submitting?

0 Answers  


What are headers in php?

0 Answers  


how to work lamp server

0 Answers  


Categories