User Tag List

Results 1 to 2 of 2

Thread: PHP MySQL Update Record

  1. #1
    Clicker Fusion 2.5

    Join Date
    Jan 2015
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP MySQL Update Record

    New to PHP. Trying to alter Jeff's highscore script to update a record and thought I could replace the insert with an update statement. Doesn't work - is there something like "$insert_the_data" for updating a record?
    // Everything is cool -- Insert the data into the database
    $query = "UPDATE $tname
    SET Pretest1 = '$Pretest1_safe'
    ,GameScore1 = '$Gamescore1_safe'
    ,SpeedScore1A = '$SpeedScore1A_safe'
    ,SpeedScore1B = '$SpeedScore1B_safe'
    ,Posttest1 = '$Posstest1_safe'
    ,Pretest2 = '$Pretest2_safe'
    ,GameScore2 = '$Gamescore2_safe'
    ,SpeedScore2 = '$SpeedScore2_safe'
    ,Posttest2 = '$Posttest2_safe'
    ,Pretest3 = '$Pretest3_safe'
    ,GameScore3 = '$Gamescore3_safe'
    ,SpeedScore3 = '$SpeedScore3_safe'
    ,Posttest3 = '$Posttest3_safe'
    ,md5 = '$security_md5'
    WHERE PlayerName = '$PlayerName_safe'";


    $insert_the_data = mysql_query($query)or die(mysql_error());
    }

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At first glance your PHP/SQL looks all right (hopefully it's sanitized for the database above this statement! ) What you could do is get it to echo $query before it runs it, to make sure that you're getting what you expect. If you submit values via the browser, how does it react?

Similar Threads

  1. Record with microphone?
    By MalcolmsMama in forum Fusion 2.5
    Replies: 2
    Last Post: 29th January 2014, 05:40 AM
  2. History Record
    By JimmyTHicks in forum The Games Factory 2 - Technical Support
    Replies: 5
    Last Post: 29th May 2012, 12:26 AM
  3. How can I record a demo?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 19th May 2010, 03:17 AM
  4. Is it possible to record gameplay?
    By vertigoelectric in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 28th July 2009, 05:36 PM
  5. Record from MMF2
    By Johnny in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 19th September 2007, 08:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •