Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change table #8

Open
1Test3 opened this issue Sep 12, 2021 · 0 comments
Open

How to change table #8

1Test3 opened this issue Sep 12, 2021 · 0 comments

Comments

@1Test3
Copy link

1Test3 commented Sep 12, 2021

Hello, how to add new columns to the table after it's already been created by the first one?

table already created
if(!SQL::ExistsTable(SQL_PLAYERS_TABLE))
{
//If not, then create a table called 'players'.
new handle = SQL::Open(SQL::CREATE, SQL_PLAYERS_TABLE); //Opening a valid handle to create a table called 'players'
SQL::AddTableColumn(handle, "p_id", SQL_TYPE_INT, 11, true); //Setting auto-increment for this field.
SQL::AddTableColumn(handle, "p_name", SQL_TYPE_VCHAR, 24);
SQL::AddTableColumn(handle, "p_password", SQL_TYPE_VCHAR, 64);
SQL::AddTableColumn(handle, "p_score", SQL_TYPE_INT);
SQL::AddTableColumn(handle, "p_posx", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle, "p_posy", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle, "p_posz", SQL_TYPE_FLOAT);
SQL::Close(handle);//Closing the previous opened handle.
}

new field that needs to be added
SQL::AddTableColumn(handle, "health", SQL_TYPE_FLOAT);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant