Jump to content
  • 0

Too many column


caspa

Question


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

i got error on this part.

post-3034-0-25586100-1370217268_thumb.jpg

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 1

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


if ( query_sql ( "SELECT 1 FROM `guild` WHERE `name` = '"+escape_sql( @gcreatenm$ )+"'", .@tmp ) ){

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

This is absolutely wrong.

SELECT `name` FROM `guild` WHERE `name`
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

It is not an error, just a warning because you read one column from the database without saving it to a variable. Thus, the script warns you that you don't do anything with the variable.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

how to solve it?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  181
  • Reputation:   53
  • Joined:  04/07/13
  • Last Seen:  

Change your query to query_sql("<your query>", .@name$).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

i don't know how to properly do it...


here's my script 

 

 

zhakastia,92,56,4    script    Guild Manager    81,{
 
    set .item1, 714; // Item ID 1
    set .item2, 677; // Item ID 2
    set .itemreq1, 9; // Ammount of item number 1 (9 since an emp is also consumed naturally upon guild creation)
    set .itemreq2, 10; // Ammount of item number 2
    set .name$, "[^FF0000Guild Manager^000000]";
    mes .name$;
    mes "Hello there "+strcharinfo(0)+".";
    mes "I can help you form a guild or disband your current one.";
    menu "Sign-up for Guild Creation.",L_create,"Disband Guild.",L_disband,"Any requirements?",L_req,"No thanks.",L_cya;
 
L_create:
    if(getpartyleader(getcharid(1)) == strcharinfo(0)) && (getcharid(2) == 0) { goto L_approve; }
    else { goto L_inguild; end; }
 
L_approve:
    next;
    mes .name$;
    mes "Alright, I need you to tell me the name you want for your guild.";
    sleep2 1500;
    input @gcreatenm$;
    mes "Are you sure that's what you want?";
    switch(select("Yes:No")) {
 
case1:
if ( query_sql ( "SELECT `name` FROM `guild` WHERE `name` = '"+escape_sql( @gcreatenm$ )+"'" ) ){
    mes .name$;
    mes "'^ff0000"+@gcreatenm$+"^000000' has already been used.";
    mes "Please try another one.";
    next;
    goto L_create;
    end;
}
if(countitem(.item1) < .itemreq1) && (countitem(.item2) < .itemreq2) { goto L_nope; end; }
    mes .name$;
    mes "Alright then let's try this...";
    atcommand "@guild "+@gcreatenm$;
    next;
    if(getcharid(2) == 0) { mes "Woops, seems like that guild already exists...try another name."; goto L_create; end; }
    announce strcharinfo(0)+" has created "+strcharinfo(2)+" Guild!",0;
    mes .name$;
    mes "Congrats.";
    delitem .item1, .itemreq1;
    delitem .item2, .itemreq2;
    close;
    end;
 
case2:
    goto L_create;
    end;
    }
 
L_disband:
    if(getcharid(2) == 0) { goto L_noguild; end; }
    if(getguildmaster(getcharid(2)) == strcharinfo(0)) { next; mes .name$; mes "Type this:"; mes "/breakguild ''"+strcharinfo(2)+"''"; close; end; }
    else { mes .name$; mes "You're not the guild leader."; close; end; }
 
L_req:
    next;
    mes .name$;
    mes "You'll need "+.itemreq1+" pieces of "+getitemname(.item1)+" and "+.itemreq2+" pieces of "+getitemname(.item2)+".";
    close;
    end;
    
L_nope:
    next;
    mes .name$;
    mes "Bring me the items first!";
    close;
 
L_inguild:
    next;
    mes .name$;
    mes "You're either already in a guild or you're not the party leader!";
    close;
 
L_noguild:
    next;
    mes .name$;
    mes "You're not even in a guild!";
    close;
 
L_cya:
    next;
    mes .name$;
    mes "Next time then!";
    close;
 
}
Edited by caspa
Link to comment
Share on other sites


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

you can also do like this if not mistaken ..

SELECT 1 FROM `guild` WHERE `name`

 

but still i believe add the part that save it into a variable would be better.

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...