Redwall: Warlords

Discussion => Help / Bugs => Topic started by: umiya on September 22, 2004, 08:31:13 PM

Title: sql install
Post by: umiya on September 22, 2004, 08:31:13 PM
 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?
Title: sql install
Post by: Veranor on September 22, 2004, 08:42:56 PM
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?
Title: sql install
Post by: umiya on September 23, 2004, 10:23:32 AM
 this is the only one i had the problem with everything else i got jsut fine :)
Title: sql install
Post by: Ashaman on September 23, 2004, 12:43:29 PM
 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.
Title: sql install
Post by: umiya on September 23, 2004, 02:57:18 PM
 only if i knew how
Title: sql install
Post by: Ashaman on September 23, 2004, 03:00:51 PM
 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.

Title: sql install
Post by: umiya on September 23, 2004, 08:56:43 PM
 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
Title: sql install
Post by: Ashaman on September 23, 2004, 11:36:57 PM
 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!');




Title: sql install
Post by: bjornredtail on September 23, 2004, 11:41:28 PM
 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.  
Title: sql install
Post by: umiya on September 24, 2004, 08:05:12 AM
 
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 :|
Title: sql install
Post by: bjornredtail on September 27, 2004, 12:27:59 AM
 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...