Jump to content

Gabsu

Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Brazil
  • Server
    Conquest
  • Discord: gabs_ko

Gabsu's Achievements

Poring

Poring (1/15)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Hey Racaae, thank you for your answer! Gonna start with a sorry here, I was being dumb lol. I started from 0 and ran some tests, fixed one or two syntax errors, and, because I made the item to call the event usable, the emulator deleted the item before the script could check if the item existed and it wouldn't work, my previous problem was just me overthinking and messing with everything lol, but thanks for trying to help!
  2. Hey everyone, I don't know if here is the right place to ask for help about this problem, sorry if it's wrong. I have an issue with the custom script Compendium and the `query_sql` function. The Problem: Inside the script (in the `OnActivate` event called by an item), the `query_sql` function fails when trying to execute a query like `SELECT id FROM compendium WHERE account_id = ...`. The function returns `Success flag: 0`, returning failure in query execution. The strangest part is that, in the same script and on the same `compendium` table, queries like `SELECT COUNT(*) FROM compendium` work perfectly (return `Success flag: 1`). Environment: * rAthena is up-to-date * MySQL: 8.0.41 * Operating System: Windows * `compendium` Table: Created with `INT UNSIGNED` for `id` and `account_id`, `ENGINE=MyISAM` (script default). Steps Already Taken: 1. Script Syntax: We checked and corrected multiple syntax errors in the script (`Compendium1.1.c`) and `item_db_usable.yml`. The script now loads without errors in the console. 2. SQL Connection: Confirmed the SQL connection is working, as `query_sql("SELECT COUNT(*) FROM login")` returns success. 3. Permissions: Verified and confirmed that the MySQL user (`ragnarok`) has `SELECT`, `INSERT`, `UPDATE` permissions on the `ragnarok` database and the `compendium` table. 4. Query Syntax: Tried various variations of the `SELECT id FROM compendium WHERE account_id = ...` query (with/without quotes around `account_id`, with/without backticks on names), all fail with `Success flag: 0`. 5. Test without WHERE: The query `SELECT id FROM compendium LIMIT 1` (without the `WHERE` clause) also fails with `Success flag: 0`. 6. Table Recreation: Tried `DROP TABLE compendium;` and let the script recreate it via `CREATE TABLE IF NOT EXISTS...` in `OnInit`. The problem persisted. 7. Logs: Checked the MySQL error logs, and there are no errors recorded at the time the `SELECT id` query fails. It seems the issue is not with the script syntax, permissions, or basic connection, but with something specific preventing the `query_sql` function from reading column data (like `id`) from the `compendium` table in this environment, even though it can count rows. Has anyone seen something similar or have any suggestions on what might be causing this specific failure in reading column data via `query_sql`? Thanks for the help!
×
×
  • Create New...