mysql_query error
#1

Hey guys, I have a little problem with Mysql_query. Here is the code.

pawn Code:
new query[126];
format(query, sizeof(query), "SELECT * FROM `users` WHERE Name = '%s'", PlayerName(playerid));
mysql_query(query); // Line 69

Code:
(69) : error 035: argument type mismatch (argument 1)
Help please.
Reply
#2

pawn Code:
mysql_query(????, query);
PHP Code:
SELECT FROM `usersWHERE `Name` =  '%s' 
Would be great if you can also tell us which plugin you use. The version actually with name of the author.
Reply
#3

Open a_mysql.inc and search for "mysql_query". The first parameter should be the connection handle I think and then it's the query.
Reply
#4

Quote:
Originally Posted by Konstantinos
View Post
Open a_mysql.inc and search for "mysql_query". The first parameter should be the connection handle I think and then it's the query.
What do I put for the Connection Handle then?
Reply
#5

You must store the connection handle to a global variable:
pawn Code:
new MySQL = -1;

// when connecting to MySQL:
MySQL = mysql_connect(...);

// when exiting the mode:
mysql_close(MySQL);

// in queries:
mysql_query(MySQL, query);
Reply
#6

Quote:
Originally Posted by Konstantinos
View Post
Open a_mysql.inc and search for "mysql_query". The first parameter should be the connection handle I think and then it's the query.
Quote:
Originally Posted by Konstantinos
View Post
You must store the connection handle to a global variable:
pawn Code:
new MySQL = -1;

// when connecting to MySQL:
MySQL = mysql_connect(...);

// when exiting the mode:
mysql_close(MySQL);

// in queries:
mysql_query(MySQL, query);
Ahh Thanks for that +rep'd.
Reply
#7

Hi. Can You Help me?
How To Solve This Problem?

Quote:

new ok[200];
format(ok,sizeof(ok),"INSERT INTO mine (cutt) VALUES (%d)", cutt);
mysql_query(query); <<<<< This PRoblem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)