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 7770977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:32:12+00:00 2026-06-01T16:32:12+00:00

At the moment im sending scores and data to my database from my flash

  • 0

At the moment im sending scores and data to my database from my flash game, though every level completed is a new record.

feilds are set out like l1Score,l2Score,l3Score

im trying to figure out how to update records if the field ipAddress and playerName match the current $varibles.

 UPDATE highscores SET l2Score = '$l2Score' WHERE ipAddress = "$ipAddress" && playerName = '$playerName'

I was thinking somthing along these lines, but could someone point me in the right direction please!

  • 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-01T16:32:13+00:00Added an answer on June 1, 2026 at 4:32 pm

    First you want to perform a query to check if there is already a score in place for that user & IP.

    $sql = "SELECT * FROM highscores WHERE ipAdress = '$ipAdress' AND playerName = '$playerName'";
    $result = mysql_query($sql, $con);
    $row = mysql_fetch_assoc($result);
    

    Now, if $row is empty then you want to insert a new record, else you want to update a previous record.

    if($row == "")
    {
       $query = "INSERT INTO highscores (l2score, ipAdress, playerName) VALUES ('$l2score', '$ipAdress', '$playerName'";
    } else {
       $query = "UPDATE highscores SET l2Score = '$l2Score' WHERE ipAdress = '$ipAdress' AND playerName = '$playerName'";
    

    You may need to edit this to fit with the specific query that you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a system at the moment that needs to copy data from a
Im trying to grab all data(text) coming from a URL which is constantly sending
I am sending data from one device to another (Samsung Tab and Sony Xperia).
I'm sending a PHP script data converted from JSON into serialised form by JQuery
Okay at the moment I my self am new to programming and learning it
At this moment we are building a new architecture that is based on the
At the moment my facebook addon is able to post URLs from the app
I'm using an AsyncTask to establish a TCP Connection and sending/receiving data through it.
I'm relatively new to python/django. I'm having an issue with sending to IDs through
At the moment I'm filling an std::vector with all of my data and then

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.