I created a procedure in phpmyadmin and when I try to insert a new row, it doesn't work. I'm trying to create a new row in the table "VOTE_TOKEN" if the current date is the same as "LAST_DATE" in the table RESERVATION. Here is the definition of my procedure:
BEGIN
DECLARE date_container_st varchar(15);
DECLARE date_array varchar(15);
DECLARE date_today varchar(15);
DECLARE date_today_array varchar(15);
SELECT OWNER_ID, LOCATING_ID, LAST_DATE
FROM RESERVATION
WHERE ID = res_id;
SET date_container_st=RESERVATION.LAST_DATE ;
SET date_today=(CHAR(15), GETDATE(), 101);
IF (date_today=RESERVATION.LAST_DATE)
THEN
INSERT INTO VOTE_TOKEN(TARGET_ID, VOTING_ID, IS_B_OWNER)
VALUES(RESERVATION.OWNER_ID, RESERVATION.LOCATING_ID, 0);
INSERT INTO VOTE_TOKEN(TARGET_ID, VOTING_ID, IS_B_OWNER)
VALUES(RESERVATION.LOCATING_ID, RESERVATION.OWNER_ID, 1);
END IF; END
When I call this procedure, phpmyadmin only returns a small table containing the "owner_id", "locating_id" and "last_date" and doesn't create any row in the table "VOTE_TOKEN"
Thanks for helping