Jump to content

Updating sql row


GhostXoP

Recommended Posts

Posted

This

dbExec( connection, "UPDATE ?? SET ??=?", tableName, columnName, columnValue ) 

is still confusing to me. Where would i specify which row?

And for creating tables, wouldn't i do

dbExec( ServerDataBase, "CREATE TABLE IF NOT EXISTS ClientData (username TEXT, data TEXT)") 

Posted

You don't specify the row, you can use the WHERE clause to know which to update, like this:

dbExec( connection, "UPDATE ?? SET ??=? WHERE ??=?", "users", "money", 5000, "name", "Test" ) 

And yes, that query should create a table.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...