Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot open.mp Questions and Suggestions [Question] [HELP ME] Creating function in Pawno

 
  • 0 Vote(s) - 0 Average
Question [HELP ME] Creating function in Pawno
PedroWarlock
Offline

Burgershot Member
Posts: 1
Threads: 1
Joined: Jan 2021
Reputation: 0
Location: Brasil
#1
2021-01-25, 04:06 PM
(google translate)
I'm trying to pass the sqlite functions to a subfunction, in order to handle all query commands for sql/mysql, but I am not able to create a simple function, I always have this type of error below, can someone help me with what I am missing?

thanks for listening!

Code:
stock Mysql_Db_free_result(DB:dbd, string[]) {

 new Result = db_query(dbd, string);
 return Result;
}

new string2[150];
format(string2, sizeof(string2), "SELECT * FROM `account` WHERE `Name`='%s' AND `key`='%s'",DB_Escape(pName),DB_Escape(password));
Result = Mysql_Db_free_result(Conection,string2);


BPR.pwn(49596) : warning 213: tag mismatch
BPR.pwn(49619) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2016, ITB CompuPhase
elite
Offline

Burgershot Member
Posts: 7
Threads: 0
Joined: Apr 2019
Reputation: 0
#2
2021-01-28, 01:33 AM (This post was last modified: 2021-01-28, 01:34 AM by elite.)
Well one of two things is happening here:
1) Your function is declared inside of another function.
2) The code following the function is not part of any function and therefore will never be called; with the exception of creating your character array as a global variable.

Both of these could definitely cause some problems however I don't know which line specifically is throwing that error.
Bakr
Offline

Burgershot Member
Posts: 14
Threads: 2
Joined: Oct 2020
Reputation: 6
Location: United States
#3
2021-01-28, 09:56 AM
db_query() returns a tag of DBResult.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode