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

How can we check the value of a given variable is a number?

0 Answers  


can anyone explain oops concept in php or give website to learn this concept clearly?

2 Answers   Nadsoft, Satyam,


Explain what does the expression exception::__tostring means?

0 Answers  


Explain mysql_errno()?

0 Answers  


What is factory pattern in php?

0 Answers  






What is the goto statement useful for?

0 Answers  


Which is not a php magic constant?

0 Answers  


Why do we use cookie?

0 Answers  


i want to need upload above 100mb file,i was successfully upload 75mb using .htaccess file ,but i can put 101mb file,it was not upload..please give some tips..local server its work perfectly but online it doesn't work.. .htaccess file details AddHandler application/x-httpd-php .php php_value post_max_size 200M php_value upload_max_filesize 200M php_value memory_limit 300M php_value output_buffering on php_value max_execution_time 259200 php_value max_input_time 259200 php_value session.cookie_lifetime 0 php_value session.gc_maxlifetime 259200 php_value default_socket_timeout 259200

1 Answers  


Tell me how can we define a variable accessible in functions of a php script?

0 Answers  


What is a closure in php?

0 Answers  


How does php isset work?

0 Answers  


Categories