Jump to content
  • 0

unknown column 'account_id' in field 'list' to this guild announce


kalabasa

Question


  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

-    script    guild_announce    -1,{
OnWhisperGlobal:
    .@guild_id = getcharid(2);
    if ( getguildmasterid( .@guild_id ) != getcharid(0) ) end;
    if ( @accountid_member == 0 )
        @total_guild_member = query_sql( "select `account_id`, `char_id` from `guild_member` where `guild_id` = "+ .@guild_id, @accountid_member, @charid_member );
    .@mes$ = @whispervar0$;
    .@name$ = strcharinfo(0);
	.@myaid = getcharid(3);
    while( .@i < @total_guild_member ) {
        if ( isloggedin( @accountid_member[.@i], @charid_member[.@i] ) ) {
            attachrid @accountid_member[.@i];
            announce "[ "+ .@name$ +" ]: "+ .@mes$, bc_self;
			attachrid .@myaid;
        }
        .@i++;
    }
}

 

 

 

Capture.PNG

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   36
  • Joined:  05/15/20
  • Last Seen:  

1 hour ago, kalabasa said:
-    script    guild_announce    -1,{
OnWhisperGlobal:
    .@guild_id = getcharid(2);
    if ( getguildmasterid( .@guild_id ) != getcharid(0) ) end;
    if ( @accountid_member == 0 )
        @total_guild_member = query_sql( "select `account_id`, `char_id` from `guild_member` where `guild_id` = "+ .@guild_id, @accountid_member, @charid_member );
    .@mes$ = @whispervar0$;
    .@name$ = strcharinfo(0);
	.@myaid = getcharid(3);
    while( .@i < @total_guild_member ) {
        if ( isloggedin( @accountid_member[.@i], @charid_member[.@i] ) ) {
            attachrid @accountid_member[.@i];
            announce "[ "+ .@name$ +" ]: "+ .@mes$, bc_self;
			attachrid .@myaid;
        }
        .@i++;
    }
}

 

 

 

Capture.PNG

There is no account_id field on guild_member table. Only char_id is available on guild_mamber table. Or you might  wanna add it.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

10 minutes ago, KazumaSatou said:

There is no account_id field on guild_member table. Only char_id is available on guild_mamber table. Or you might  wanna add it.

do they have the same value?

`account_id` int(11) unsigned NOT NULL default '0',

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   36
  • Joined:  05/15/20
  • Last Seen:  

Just now, kalabasa said:
11 minutes ago, KazumaSatou said:

o account_id field on guild_member table. Only char_id is available on guild_mamber table. Or you might  wanna add it.

do they have the same value?

`account_id` int(11) unsigned NOT NULL default '0',

Yeah same type. But I think you need to add that in src to make it automatically added the account id once a player joins guild.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

i added on mysql workbench. no error but it does not work. i have no idea how to put it on src.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

the account_id has been deprecated from the database long time ago, simply adding back the column wont make it work since the column wont have any values stored in it.

You have to change the SQL statement to retrieve the info that you needed.

@total_guild_member = query_sql( "SELECT `account_id`, `char_id` FROM `char` WHERE `guild_id` = "+ .@guild_id, @accountid_member, @charid_member );

 

or a simple attempts

-    script    guild_announce    -1,{
OnWhisperGlobal:
	if (!getcharid(2)) end;
	.message_owner$ = strcharinfo(0);
	.message$ = "";
	for (.@i = 0; .@i < 10; .@i++)
		.message$ = .message$ + ((.@i > 0) ? "#":"") + @whispervar0$;
	addrid(3, 0, getcharid(2));
	announce "[ "+ .message_owner$ +" ]: "+ .message$, bc_self;
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

On 3/5/2022 at 8:23 PM, Emistry said:

the account_id has been deprecated from the database long time ago, simply adding back the column wont make it work since the column wont have any values stored in it.

You have to change the SQL statement to retrieve the info that you needed.

@total_guild_member = query_sql( "SELECT `account_id`, `char_id` FROM `char` WHERE `guild_id` = "+ .@guild_id, @accountid_member, @charid_member );

 

or a simple attempts

-    script    guild_announce    -1,{
OnWhisperGlobal:
	if (!getcharid(2)) end;
	.message_owner$ = strcharinfo(0);
	.message$ = "";
	for (.@i = 0; .@i < 10; .@i++)
		.message$ = .message$ + ((.@i > 0) ? "#":"") + @whispervar0$;
	addrid(3, 0, getcharid(2));
	announce "[ "+ .message_owner$ +" ]: "+ .message$, bc_self;
	end;
}

 

no idea if its working but when i type a message it alway shows ########

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...