How can I create an agenda for the webbased app ? If this is possible ?
Create an agenda for within the app
-
- User
- Posts: 5
- Location: brazil
I could do as
create the tables
CREATE TABLE agend (
id
int NOT NULL,
data
DATE NOT NULL
day_sem INT NOT NULL,
sem_year INT NOT NULL,
PRIMARY KEY(data
)
) ENGINE=MyISAM;
and
CREATE TABLE number (
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id)
) ENGINE=MyISAM;
and
INSERT INTO number VALUES(NULL);
INSERT INTO number SELECT NULL FROM number ; // running 12 times = 4096 records
and
INSERT INTO agend
SELECT
DATE_ADD('2015-01-01', INTERVAL id-1 DAY),
DAYOFWEEK(DATE_ADD('2015-01-01', INTERVAL id-1 DAY))-1,
WEEKOFYEAR(DATE_ADD('2015-01-01', INTERVAL id-1 DAY))
FROM number ;
and
CREATE TABLE tarefa (
codtarefa INT NOT NULL AUTO_INCREMENT,
codusuario INT NOT NULL,
codtiporepeticao INT NOT NULL,
dtainicio DATE NOT NULL,
PRIMARY KEY(codtarefa)
) ENGINE=innodb;
this far already have the agenda
Now create the table that will be related to tasks or activities
CREATE TABLE ativict (
codativict INT NOT NULL AUTO_INCREMENT,
codusur INT NOT NULL,
codservant INT NOT NULL,
starttime time NOT NULL,
endtime time NOT NULL,
iddata int NOT NULL,
PRIMARY KEY(codativict )
FOREIGN KEY(iddata ) REFERENCES agend (id)
) ENGINE=innodb;
table daughter activity will be on the agenda
and PHPMaker relate the table calendar >>> activity
to be saved several atividas for a day and a day has several activities
the rest depends on your imagination and the power of PHPMaker
I have helped
-
- User
- Posts: 57
When I try the first one, I get an error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'day_sem INT NOT NULL, sem_year INT NOT NULL, PRIMARY KEY(data
) ) ENGINE=M' at line 4
Did I overlooked something ?