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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you upload a file using php?

553


How to create a public static method in PHP?

553


Tell me how to retrieve a cookie value?

535


Explain the value of the variable input is a string 1,2,3,4,5,6,7. How would you get the sum of the integers contained inside input?

575


What are the 3 types of sessions?

547






How can php and javascript interact?

751


How can you get the size of an image in PHP?

548


How to write comment in php?

698


What is the meaning of die in php?

529


What is the interface in php?

536


What function do we use to find length of string, and length of array?

533


What is php addslashes?

549


What is isset post?

571


How cookies are trported from browsers to servers?

572


Which software is used to run php programs?

525