You could also, for #2, simply record the changes to the database and allow
those commands to be recalled and reversed. So, say that someone queried:
INSERT INTO table_name (a1, b2, c3, d4) VALUES (joe, john, judy, jackie);
You could make an undo available as an include that can parse it as a regexp
and see that INSERT needs to be DROP and the (a1, b2, c3, d4) and (joe,
john, judy, jackie) need to be WHERE values, so it would parse it as:
DROP FROM table_name WHERE a1="joe" AND b2="john" AND c3="judy" AND
d4="jackie";
The best idea is to create an include file that can parse simple quireies
and create opposite queries to go with them using some CASE statements
probably. Hmmm, maybe this will be my next project. Hehehe!
It could even go to the point of having a setup where it logs $client as
$REMOTE_ADDR for internet or and internal user value for intranet stuff, so
that they can back out as many commands as they need to. The nice thing is
that you could back out accidental deletes the same way as long as the DROP
query contained ALL of the data (the way phpMyAdmin does it).
Perhaps the table could be accessed by an admin through a web interface even
to backout as many items as may need be.
Jesse Williams
System Administrator
DowNET VoIP Team
Electronic Data Systems
-----Original Message-----
From: Michel Laine [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 05, 2001 10:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Is this possible?
Using PHP 404pl1 / MySQL 3.23.35 / PWS / W98SE if anybody should need to
know...
The stuff is for an intranet application.
1: To execute php code when a A HREF link is clicked.
I have the need to change a session variable depending on which link (of
a couple) that is clicked. The link is supposed to call $PHP_SELF which
then change its output depending on the value of the session variable.
I know that i can solve it by letting the link call different php
scripts - which update the session variable and then call back to the
first page.
If there is another way ( javascript maybe?), i am interested to know
about it.
2: To have one undo step on a database update.
Do anybody know / seen any example / tutorial on how this kind of
function can be implemented?
Let me know!
I have read most of the stuff at Newbie network, PHPdeveloper,
PHPeverywhere, Zend, Devshed, Webmonkey and PHPbuilder - but i have
never come across anything like this.
--
Michel Laine
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]