sql install

Started by umiya, September 22, 2004, 08:31:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

umiya

 when doing the sql isntall and on this step

INSERT INTO `servers` VALUES ('prom', 'Promisance', 0, 0, 0, 0, 'No Turns Yet!');

mysql puts out the following

MySQL said:
#1136 - Column count doesn't match value count at row 1


any fix for it?

Veranor

Quote from: umiyawhen doing the sql isntall and on this step

INSERT INTO `servers` VALUES ('prom', 'Promisance', 0, 0, 0, 0, 'No Turns Yet!');

mysql puts out the following

MySQL said:
#1136 - Column count doesn't match value count at row 1


any fix for it?
You'll hit that problem on several steps I believe. I think you have there are too many/few values you are trying to insert. I either deleted one from the  Query or from the table, though neither is probably the right idea.


Retto?
#127.0.0.1 rovl.org

umiya

 this is the only one i had the problem with everything else i got jsut fine :)

Ashaman

 Why don't you specify the fields to be sure?

INSERT INTO `servers` (Field1, Field2, etc...) VALUES ('prom', 'Promisance', 0, 0, 0, 0, 'No Turns Yet!');

Just to make sure that there are enough fields to every values.  And to not leave SQL determine what values goes into what default field.

umiya


Ashaman

 Well, try this.

First, get a description of the servers table to see what fields belong in that table.  I believe it is

desc servers

Then, match up all the fields with the correct values from your values statement.  For example:

INSERT INTO `servers` (GameType, GameName, Value1, Value2, Value3, Value4, TurnsAvailable) VALUES ('prom', 'Promisance', 0, 0, 0, 0, 'No Turns Yet!');

Now, the field names used in the above statements are purely fictionals.  But I hope you get the idea behind it and understand what those values you're trying to insert into the table actually mean.


umiya

 CREATE TABLE `servers` (
 `name` varchar(50) NOT NULL default '',
 `title` varchar(200) NOT NULL default '',
 `players` int(11) NOT NULL default '0',
 `turns` int(11) NOT NULL default '0',
 `reset` tinyint(3) unsigned NOT NULL default '0',
 `hidden` tinyint(1) unsigned NOT NULL default '0',
 `url` varchar(200) NOT NULL default '',
 `news` text NOT NULL
) TYPE=MyISAM;

use this to base ur mysql query for i cant figure it out...i have no experience with mysql quiers so i really dont know how it should look

Ashaman

 Well, I have no idea why you want to insert this VALUES ('prom', 'Promisance', 0, 0, 0, 0, 'No Turns Yet!');
into the servers table.  I thought you already know what those values stand for.  However, looking at the servers table, it appears many of those field already have default values and thus, don't need to be specified in the insert statement unless the values are different from the default values.

Hence, I'll take a wild guess at the meaning of the values you're trying to insert.
VALUES ('prom', 'Promisance', 0, 0, 0, 0, 'No Turns Yet!');
'prom' - stand for server name?
'Promisance' - probably is the title of the game
'No Turns Yet!' - either belong to "url" field or "news" field.  I guess it's the "news" field since it doesn't look anything like an "url"
So, to make MySQL stop complaining, you can do the following line (NOTE: this will only make MySQL not complain, it doesn't guarantee the values were intended for the fields being used)


INSERT INTO `servers` (name, title, news) VALUES ('prom', 'Promisance', 'No Turns Yet!');
*the 4 0's are not needed since they are already defaulted.  Or you could do the following if you don't want to remove the 4 0's
INSERT INTO `servers` (name, title, players, turns, reset, hidden, news) VALUES ('prom', 'Promisance', 0, 0, 0, 0, 'No Turns Yet!');





bjornredtail

 http://www.redwallwarlords.com/forums/index.php?a...t=ST&f=7&t=5121

Yes, I already found it. *digs out setup script*

$insert["servers"] = "INSERT INTO `servers` VALUES ('$config[server]', '$config[servname]', 0, 0, 0, 0, '$config[sitedir]', 'No Turns Yet!');";

Copypaste that over the insert function for the servers table. That ought to work, assumeing you set the $config[sitedir] variable up correctly. The problem is Retto forgot to put the ULR of the server into the insert function.  
0==={=B=J=O=R=N=R=E=D=T=A=I=L==>
AKA, Nevadacow
First person to ever play RWL

"Program testing can be used to show the presence of bugs, but never to show their absence!"-Edsger W. Dijkstra

Visit http://frostnflame.org today!

umiya

 
Quote from: nevadacowhttp://www.redwallwarlords.com/forums/index.php?a...t=ST&f=7&t=5121

Yes, I already found it. *digs out setup script*

$insert["servers"] = "INSERT INTO `servers` VALUES ('$config[server]', '$config[servname]', 0, 0, 0, 0, '$config[sitedir]', 'No Turns Yet!');";

Copypaste that over the insert function for the servers table. That ought to work, assumeing you set the $config[sitedir] variable up correctly. The problem is Retto forgot to put the ULR of the server into the insert function.
that stilll isnt right, i used what ashaman said then mauly added the site url and it turned out good for me....but now im getting errors trying to login :S

ok i got the login fixed but how do i take it out of lite view.....once ur logged in its in lite mode and i cant figure out how to turn it off :|

bjornredtail

 Now that is weird.... Problem is in rwl.php (or is it html.php... Can't rember off hand. One of the two). Only thing is I don't know why it wouldn't work on your end, but it does work on mine...
0==={=B=J=O=R=N=R=E=D=T=A=I=L==>
AKA, Nevadacow
First person to ever play RWL

"Program testing can be used to show the presence of bugs, but never to show their absence!"-Edsger W. Dijkstra

Visit http://frostnflame.org today!