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






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SQL Problem...
Author Message
Artyk
Journeyman
*

Posts: 75
Likes Given: 43
Likes Received: 9 in 9 posts
Joined: Sep 2014
Reputation: 0



Post: #7
RE: SQL Problem...
(09-12-2015 03:29 AM)Coruja Wrote:  you must use the arguments in correct order, you wrote SELECT [a] FROM WHERE [b] [c] but the correct is SELECT [a] FROM [b] WHERE [c]

Code:
DB.QUERY "SELECT * FROM myrunuo_characters_skills WHERE char_id='<UID>' LIMIT 1
IF (<DB.ROW.NUMROWS>)
  FOR 1 49
    DB.EXECUTE "UPDATE myrunuo_characters_skills SET skill_id=<dLOCAL._FOR>, skill_value=<I.<LOCAL._FOR>> WHERE char_id=<UID> LIMIT 1"
  ENDFOR
ELSE
  FOR 1 49
    DB.QUERY "INSERT INTO myrunuo_characters_skills (char_id, skill_id, skill_value) VALUES ('<UID>', '<dLOCAL._FOR>', '<I.<LOCAL._FOR>>')"
  ENDFOR
ENDIF

Coruja did correct your code in the right way, the problem is that there is a logical error: for each row you're updating skill_id and skill_value checking if char_id = <UID>. You should only set skill_value=<I.<LOCAL._FOR>>, checking if char_id=<UID> and skill_id=<dlocal._FOR>
09-17-2015 05:44 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
SQL Problem... - admin_teclis - 09-12-2015, 12:33 AM
RE: SQL Problem... - azmanomer - 09-12-2015, 12:54 AM
RE: SQL Problem... - admin_teclis - 09-12-2015, 01:57 AM
RE: SQL Problem... - Coruja - 09-12-2015, 03:29 AM
RE: SQL Problem... - admin_teclis - 09-17-2015, 08:12 AM
RE: SQL Problem... - Artyk - 09-17-2015 05:44 PM
RE: SQL Problem... - Extreme - 09-17-2015, 12:15 PM

Forum Jump:


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