Quote:
Originally Posted by Natsheh
Show the SQL. Query of creating the table.
|
HTML Code:
query = SQL_PrepareQuery(link,
"CREATE TABLE IF NOT EXISTS `results`( \
id INT(11) UNSIGNED, \
mid INT(11) UNSIGNED, \
besttime INT(11) NOT NULL, \
games INT(11) NOT NULL, \
playedtime INT(11) NOT NULL, \
deaths INT(11) NOT NULL, \
FOREIGN KEY(id) REFERENCES `runners`(id) ON DELETE CASCADE, \
FOREIGN KEY(mid) REFERENCES `maps`(mid) ON DELETE CASCADE, \
PRIMARY KEY(id, mid) \
)");
SQL_Execute(query);
SQL_FreeHandle(query);
query = SQL_PrepareQuery(link,
"ALTER TABLE `results` \
ADD recorddate DATETIME NULL");
SQL_Execute(query);
SQL_FreeHandle(query);