"Bawie" sie wlasnie skryptem typerow Prediction League i juz na samym poczatku, podczas instalacji i konfiguracji bazy (MySql) mam juz maly problem. Skrypt instalacyjny tworzy baze a nastepnie tabele potrzebne do dzialania skryptu. Baza tworzy sie bez problemu. Problem pojawil sie przy tworzeniu tabel. Z tego co zauwazylem z tabela, w ktorej primary key nie jest auto_increment nie ma problemu - tworzy sie. Lecz gdy primary key jest auto_increment pojawia sie nastepujacy error:
Query failed: create table pl.pluserdata (lid int not null , userid int not null auto_increment, username varchar(32) not null , password varchar(40), email varchar(60), icon varchar(128), lang varchar(32), usertype smallint, dflths smallint default 0, dfltas smallint default 0, since DATE, isauto enum('Y','N') default 'N', primary key (lid, userid));
Incorrect table definition; there can be only one auto column and it must be defined as a key
Ponizej kod, ktory tworzy tabele, ktorej blad widnieje powyzej:
<?php $query = "create table $dbname.$dbaseUserData (lid int not null , userid int not null auto_increment, username varchar($userlen) not null , password varchar($passlen), email varchar($emaillen), icon varchar($fnamelen), lang varchar(32), usertype smallint, dflths smallint default 0, dfltas smallint default 0, since DATE, isauto enum('Y','N') default 'N', primary key (lid, userid));"; ?>
A ponizej fragment, ktory nie wywala bleu i poprawnie tworzy tabele:
<?php $query = "create table $dbname.$dbasePredictionData (lid int not null , userid int not null, matchid int not null, predtime timestamp, homescore smallint unsigned, awayscore smallint unsigned, isauto enum('Y','N') default 'N', primary key(lid, userid, matchid))"; ?>
Co jest nie tak. Zaznaczam, ze nic sam nie kombinowale - jest to fragment oryginalnego skryptu tworzacego tabele...
Pozdrawiam
Darth