• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] MySQL query doesn't trigger my function
#1
Hello,

I've been trying to make a command that's gonna read my logs table on my MySQL database...

Here is the code

PHP Code:
if (!strcmp(by"Account"true)) {
format(conditionssizeof(conditions), "WHERE `Account` ");
}
else if (!
strcmp(by"ToAccount"true)) {
format(conditionssizeof(conditions), "WHERE `ToAccount` ");
}
else if (!
strcmp(by"Text"true)) {
format(conditionssizeof(conditions), "WHERE `Log` ");
}

if (
contains == 1) {
format(conditionssizeof(conditions), "%sLIKE '%"conditions);
format(conditionssizeof(conditions), "%s%s"conditionssearch);
format(conditionssizeof(conditions), "%s%%'"conditions);
}
else {
format(conditionssizeof(conditions), "%s= '%s' "conditionssearch);
}

new 
query[1024];
format(conditionssizeof(conditions), "%sAND lt.LogType = '%s' ORDER BY Timestamp %s LIMIT %d"conditionslogtypeorderresultNo);
mysql_format(g_SQLquerysizeof(query), "SELECT * FROM `logs` AS l JOIN `logtypes` AS lt ON l.LogType = lt.LogTypeId %e"conditions);
mysql_tquery(g_SQLquery"LogSearchResults""d"playerid); 


The function LogSearchResults doesn't even get triggered. I printed out the query and got something that returns results when I run it manually..

Any ideas? :(

This is the print out i got:

PHP Code:
SELECT FROM `logs` AS l JOIN `logtypes` AS lt ON l.LogType lt.LogTypeId WHERE `Account` = 'dock' AND lt.LogType 'localchat' ORDER BY Timestamp desc LIMIT 50 
  Reply
#2
If there is an error in the execution of the query, the callback will not be triggered.
Did you check the mysql_log?
  Reply


Forum Jump: