Jump to content

Problem with MySQL 5.6 select query


Go to solution Solved by Great,

Recommended Posts

Hi. Maybe it's easy but, i have problem with that ;/ I have a MySQL 5.6 and Vanilla core 2.3 with db.

When I use a game.mysql_query in quest with "SELECT", and put it into chat I have a empty chat, and nothing in sysser, but when I put query into e.g "chat("something"..query.." ") i have this error in sysser:

SYSERR: Apr 26 11:31:02 :: RunState: LUA_ERROR: [string "test_quest"]:3: attempt to concatenate local `query' (a table value)
SYSERR: Apr 26 11:31:02 :: WriteRunningStateToSyserr: LUA_ERROR: quest test_quest.start click

Part of e.g quest

local query = game.mysql_query('SELECT name FROM player.player WHERE id = 70984')
	chat("something"..query.." ")

But when I use this query in navicat everything is ok.

I'll be grateful for the help :)

Link to comment
Share on other sites

I prefer to set a test whether the variable exists. If your query fails, the table is empty, or in the worst case, nil.

So you can test it with an if statement like that :

if query and query[1] then
-- or
if (query or {}) [1] then
-- or
chat('sth '.. ((query or {{0}})[1] or {0})[1})
the latest is pro code, you don't need to understand it, but if you do, Nice :)

With those statements you prevent syserr messages

Sent by Tapatalk @ Galaxy Note 10.1

  • Love 2
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 13

      Metin2 Closed Beta Content (2003-2004)

    2. 25

      [SRC] Metin2 on LINUX - The Old Metin2 Project

    3. 2

      United/Club/Midgard serverfiles?

    4. 13

      Metin2 Closed Beta Content (2003-2004)

    5. 13

      Metin2 Closed Beta Content (2003-2004)

    6. 0

      Football Ground

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.