Annulé

PHP Script to Create MySQL Triggers

I need a simple PHP script to drop then create triggers for every table in a database based on the column names in each table.

Do not bid if:

- You do not fully understand the project

- You can't test it on your own computer / server

- You want to be paid up front

- You cannot begin working straight away and finish it within 3hr of me accepting your bid

Pseudocode for the script / trigger:

######################

For Each Table in Database

Drop Trigger If It Exists

Create Trigger

Name: "{{Table_Name}}_PreInsert"

Definer: "root@localhost"

On Table: "{{Table_Name}}"

Event: Before Insert

Trigger:

BEGIN

SET @Record = (

SELECT AUTO_INCREMENT FROM [url removed, login to view]

WHERE TABLE_SCHEMA=DATABASE()

AND TABLE_NAME='{{Table_Name}}'

);

SET @PrevRecrd = @Record-1;

IF ([url removed, login to view] IS NULL) THEN

SET [url removed, login to view] = @Record;

END IF;

SET @PrevHash = (

SELECT HASH FROM {{Table_Name}}

WHERE Record=@PrevRecrd

);

SET [url removed, login to view] = SHA1(CONCAT_WS(',',@PrevHash, @Record,

new.Col_Name2, new.Col_Name3, new.Col_Name4, new.Col_Name5 #<---- FOR EVERY COLUMN IN TABLE EXCEPT FOR COLUMNS NAMED "Record" AND "Hash"

));

END

###########

Write "Yes, I have read your project" in your bid comment to prove that you have actually read and understand it.

Compétences : MySQL, PHP

Voir plus : php triggers, php mysql create trigger, script drop create, script triggers, php script null, write a simple php script, Pseudocode, php script create table, mysql test, 3hr, script event, php insert select, write simple php database, create event, comment mysql, php localhost, write test script, write mysql, insert mysql table, php script server, php script read table, mysql record, mysql create server, php script name, create event mysql

Concernant l'employeur :
( 2 commentaires ) Auckland, New Zealand

N° du projet : #2336668

3 freelance ont fait une offre moyenne de 30 $ pour ce travail

mohamedgamal2012

Hello I'm php developer with very good experience so I'll do it withing 2 hours

30 $ NZD en 0 jours
(1 Commentaire)
0.0
Bto30OPL5

Custom software development - <b><i>Removed by Admin</i></b>

30 $ NZD en 1 jour
(0 Commentaires)
0.0
imrantufail

Yes, I have read your project and i can help you.

30 $ NZD en 2 jours
(0 Commentaires)
0.0