Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8243287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:27:56+00:00 2026-06-07T21:27:56+00:00

When a player moves an item to his character the item type(type) is sent

  • 0

When a player moves an item to his character the item type(type) is sent to the server

in the case where a player equips an armband the type = “bracelet” Id like it to attempt to put the item id in the leftbracer column under the game_moblist (players and badguys in game) table first then the right if the left has an item_id already. I use the value = 0 to indicate an empty slot.

if (type=="bracelet"){
    to_sql="UPDATE game_moblist SET leftbracer"="+item_id+" WHERE id="+player_id
}

previously I was using a select first but I’d like to do it in 1 query. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:27:58+00:00Added an answer on June 7, 2026 at 9:27 pm

    Just use an IF to se if leftbracer = 0, and set the value to either the new item id or keep the old value

    UPDATE game_moblist SET 
       rightbracer = IF(leftbracer = 0, rightbracer, :item_id),
       leftbracer = IF(leftbracer = 0, :item_id, leftbracer );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a turn based hex-grid game. The player selects units and moves
I'm programming a game which sends the position of the player to the server
Think card game ... Computer attacks human with a card. In response, player moves
I have a snake game like player and I'm running into some problems when
I'm currently creating a game (Gomoku) where user needs to input his moves to
I'm developing an iPhone game using cocos2d. As the player moves around and scores
I am coding a web based game in which the player moves around on
I'm developing a 2D infinite side scrolling game. As the player moves to the
I have the following code: <video width=640 height=360 controls id=video-player poster=/movies/poster.png> <source src=/movies/640x360.m4v type='video/mp4;
A player: http://www.yvoschaap.com/videowall/ How can you customise the above Chromeless Youtube to have Play/Stop/Pause

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.