Update table after payment completed PHP

0

Well I'm trying to automate the release of products in my store so I made a purchase status system only that does not update the line that was paid ie create a new line

See: link

I just do not know how to update a specific line ...

Code that takes the data: link

[TRY] Code that updates SQL:

  

Warning: I am a beginner in PHP so I was kind of lost ...

$status = $_GET["status"];

$ usernick = $ _SESSION ['user'];

$ query="SELECT * FROM purchases WHERE item_token = '". $ _ SESSION [' token ']. "'"; // WHERE="Condition -> 'if, where'" - > In this case, a search will be done in the store_items table to get the data of a certain item $ result = @mysql_query ("$ query"); // start the search while ($ row = @mysql_fetch_array ($ result)) {// while re-arranges all the components of this table, such as ID, NAME, EMAIL and other ARGUMENTS, where ROW = rows $ get_id = stripslashes ($ row ['id']); // In this case, I set the row of the NAME to the name of the item and get its value.

$ query26="UPDATE register SET status = '$ status' WHERE id = '$ get_id'"; // Define a variable to insert DATA into the table. NOTE: You do not need to enter the ID, because you defined it as AI (Auto Increment) mysql_query ($ query26); // Insert values set in $ query26

}

    
asked by anonymous 31.05.2017 / 19:09

0 answers