Results 1 to 4 of 4
  1. #1
    Registered User Felicityges's Avatar
    Join Date
    Aug 2020
    Location
    Missouri Kansas City
    Posts
    11

    How do change data in a database?

    i have list of list

    listofplayers = [[player1, 5,1,300,100],[player11, 10,5,650,150],[player23, 17,6,1100,1050]]

    and i have a database

    player, win, lost, moneywin, moneylost
    player1, 3 , 0 , 250 , 50
    player2 ...
    player3 ...
    ...

    how do i update my database with the new info in my listofplayers? Like this:

    player, win, lost, moneywin, moneylost
    player1, 5, 1, 300, 100,
    player2 ...
    player3 ...
    player11, 10, 5, 650, 150
    player23, 17, 6, 1100, 1050

    i tried different things but i just can't find the resources

    here's my best attempt:

    1
    2
    3
    4
    5
    6
    7
    8

    for i in listofplayers
    for j, k in db.iterrows():
    if i[0] == j['player']:
    index = db.index[db[j]==k].tolist()
    db.at[index,j] = i[y]
    index = []
    y+=1

    as you can see i'm having troubles...
    this is my very first attempt at pandas and i'm still new to programming

  2. #2
    Registered User
    Join Date
    Aug 2022
    Posts
    2
    You will need to use SQL (database query language) and other complicated programs.

  3. #3
    Registered User
    Join Date
    Aug 2022
    Posts
    1
    Do you know how to work with SQL? Transact-SQL and SQL Server Management Studio are the tools to change data in a database. You will need to access the data editor then select the commands to replace for edit, tap quick find next to find and replace. There are many tutorials on youtube and mysql.com that can serve as a guide for you. In case, you are lack data for your database read about the features of B2B data providers. Shortly, data providers will enrich your database with reliable information.
    Good luck!
    Last edited by Evonne Millier; 09-02-2022 at 09:30 AM.

  4. #4
    Member
    Join Date
    Feb 2019
    Posts
    32
    You must have a certain level of knowledge in working with SQL. Otherwise, you will need the help of a specialist. In any case, I recommend making backups and using a monitoring service https://www.host-tracker.com/en/ to track the performance of the project after making changes.

Posting Permissions

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

  Find Web Hosting      
  Shared Web Hosting UNIX & Linux Web Hosting Windows Web Hosting Adult Web Hosting
  ASP ASP.NET Web Hosting Reseller Web Hosting VPS Web Hosting Managed Web Hosting
  Cloud Web Hosting Dedicated Server E-commerce Web Hosting Cheap Web Hosting


Premium Partners:


Visit forums.thewebhostbiz.com: to discuss the web hosting business, buy and sell websites and domain names, and discuss current web hosting tools and software.