0

how do i create a trigger to display the columns of the record after it is inserted into the table.
how do integrate php and mysql to do so?

Edited by pritaeas: No longer a MySQL question.

2
Contributors
7
Replies
10
Views
5 Years
Discussion Span
Last Post by pritaeas
0

how do i create a trigger to display the columns of the record after it is inserted into the table.

Can you explain what you want? A trigger is for modifying data, not for displaying.

0

i need to display the contents of the record EVERYTIME a new record is inserted into a table.
how do i go about it?

0

MySQL cannot trigger PHP when there is an insert/update. You would need to use a polling mechanism from PHP, query for changes every N seconds/minutes (assuming adding and viewing are two separate disconnected entities).

0

i am completely new to mysql/php.
could you please elaborate on how i should do that?

0

Clarify in more detail what you have in mind. How you think it should work. It's hard to guess with so little info.

0

ok this is my problem description:
in my database i have a table named student. everytime an insert/update/delete is performed on student, the old values, the action performed(i.e inssert/update/delte), time&date of change is stored in another table student_history.
now what i am asked to do is, create an "echo" statement using php, to display columnA and columnB of the record inserted into student_history. i.e everytime an insert is performed on student_history, a new page should open up indicating the value of columnA and columnB of the inserted record. and if 10 records are inserted simultaneously, 10 windows should open, indicating the inserted record

0

Echoing in PHP is easy, but opening a new page is something PHP cannot do. You probably need some Javascript and AJAX.

This is no longer a simple MySQL question, I'll move this thread to Web Development.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.