The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Strange MySQL Behavior
Author Message
n1ghtwish
Apprentice
*

Posts: 40
Likes Given: 0
Likes Received: 28 in 8 posts
Joined: Jan 2016
Reputation: 0



Post: #1
Strange MySQL Behavior
First and foremost:
Windows 7 - .56c-Nightly Build 2681 2/6/2016

Okay, so I have TWO functions, whose names have been changed for simplicity... also, it is assumed that I have a working and established MySQL database connection with the following tables:

"testing" and "accounts"

The "accounts" table was created (last week) to mirror the accounts from Sphere and also keep an updated web-accessible record of last used IPs, last connect time, passwords, etc... it's also used as a web-based account registration system. PHP form --> MySQL table --> Sphere, via various scripts. This table currently has two rows, both containing data for the two accounts that I have in Sphere.

The "testing" table was created later (today) to debug the issue at hand. This table contains 9 rows of data, some empty entries included just to see if Sphere will handle it. The columns are named "data1" "data2" etc... and the rows have basic strings like "hello" and "fdhsjfa478343".

On to the functions:
Code:
[function function2]
db.query "select * from testing"

[function function1]
db.query "select * from accounts"

function2 gives me no console activity, so I did this:

Code:
[function function2]
db.query "select * from testing"
for x 0 <eval <db.row.numrows> -1>
    serv.log @TEST: Row # <dlocal.x> - data = <db.row.<dlocal.x>.2>
endfor

Running the above command gives me a nice clean loop through the data in column 2, including some empties. No console errors.

Back to function1, still looking like this:

Code:
[function function1]
db.query "select * from accounts"

and this is what I get....

Code:
23:01:DEBUG:__ thread (3772) __ |  # | _____ function _____________ | ticks passed from previous function start ______
23:01:DEBUG:>>         3772     |  0 |              CServer::OnTick | +0
23:01:DEBUG:>>         3772     |  1 |        CServer::OnConsoleCmd | +0
23:01:DEBUG:>>         3772     |  2 |              CServer::r_Verb | +0
23:01:DEBUG:>>         3772     |  3 |           CScriptObj::r_Call | +0
23:01:DEBUG:>>         3772     |  4 |     CScriptObj::OnTriggerRun | +0
23:01:DEBUG:>>         3772     |  5 |              CServer::r_Verb | +0
23:01:DEBUG:>>         3772     |  6 |           CScriptObj::r_Verb | +0 <-- exception catch point (below is guessed and could be incorrect!)
23:01:DEBUG:>>         3772     |  7 |                CGFile::Close | +0
23:01:CRITICAL:(sphere_sql_functions.scp,47)"Access Violation" (0x16cf44), in CScriptObj::Verb()
23:01:DEBUG:command 'db.query' args '"select * from accounts' [0297B680]

If I run the FOR loop on "accounts" table, I get a return on the FIRST row only, the above error still happens, and then my FOR loop is broken... even tried adding more rows to the mix, and the loop breaks after the first row is returned.

BOTH tables were created using PHPMyAdmin... I have renamed columns, tables, rows, even renamed data to take out all special characters and try to get the two similar in the sense that they both contain simple columns and rows of data... each and EVERY time I run these tests, each and every WAY I can possibly think of, I get the same results... Sphere hates the table I need to use, and likes the table that I don't.

Edit: I also forgot to mention that this does not happen with the pre-release executable.

Confused

-NW
(This post was last modified: 02-08-2016 05:20 PM by n1ghtwish.)
02-08-2016 05:19 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Strange MySQL Behavior - n1ghtwish - 02-08-2016 05:19 PM
RE: Strange MySQL Behavior - darksun84 - 02-09-2016, 07:20 AM
RE: Strange MySQL Behavior - n1ghtwish - 02-09-2016, 02:25 PM
RE: Strange MySQL Behavior - Ben - 02-12-2016, 03:24 AM
RE: Strange MySQL Behavior - n1ghtwish - 02-15-2016, 04:23 AM
RE: Strange MySQL Behavior - n1ghtwish - 02-15-2016, 04:01 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)