IS it a way to merge a variable called "bob" in the table foo, with my variable bob2 in my table foo2?
so they match eachother all the times.
Since im updating "bob". i want if that value changes, it also does to bob2, and vise versa.
Is this possible?
EDIT:
CREATE TABLE IF NOT EXISTS `stats` (
`ID` int(11) NOT NULL auto_increment,
`player` varchar(12) default '',
`rank` varchar(12) default '',
`winpot` int(20) default '0',
`gamesplayed` int(11) default '0',
`tournamentsplayed` int(11) default '0',
`tournamentswon` int(11) default '0',
`handsplayed` int(11) default '0',
`handswon` int(11) default '0',
`bet` int(11) default '0',
`checked` int(11) default '0',
`called` varchar(11) default '0',
`allin` varchar(11) default '0',
`fold_pf` varchar(11) default '0',
`fold_f` varchar(11) default '0',
`fold_t` varchar(11) default '0',
`fold_r` int(11) default '0',
PRIMARY KEY (`ID`)
FOREIGN KEY (winpot) REFERENCES brukere(hand)
);
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 'FOREIGN KEY (winpot) REFERENCES brukere(hand) )' at line 20
im trying to get winpot reference to hand in the table brukere.
What is wrong here?
edit2:
create table brukere(
hand int(20) NOT NULL,
id int(20) NOT NULL auto_increment,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS `stats` (
`ID` int(11) NOT NULL auto_increment,
`player` varchar(12) default '',
`rank` varchar(12) default '',
`winpot` int(20),
`gamesplayed` int(11) default 0,
`tournamentsplayed` int(11) default 0,
`tournamentswon` int(11) default 0,
`handsplayed` int(11) default 0,
`handswon` int(11) default 0,
`bet` int(11) default 0,
`checked` int(11) default 0,
`called` varchar(11) default '0',
`allin` varchar(11) default '0',
`fold_pf` varchar(11) default '0',
`fold_f` varchar(11) default '0',
`fold_t` varchar(11) default '0',
`fold_r` int(11) default 0,
PRIMARY KEY (`ID`),
FOREIGN KEY (winpot) REFERENCES brukere(hand)
);
Schema Creation Failed: Can't create table 'db_2_7249b.stats' (errno: 150):
( could not upload trought SQL ( still looking into that) . so posted it here. Hope you dont mind
what is wrong here?