Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee

Human-written only.

24/7 Support

Anytime, anywhere.

Plagiarism Free

100% Original.

Expert Tutors

Masters & PhDs.

100% Confidential

Your privacy matters.

On-Time Delivery

Never miss a deadline.

Sqlite with C language(just C, not C++ or anthing else)   how can i insert data into the database with C language after i open my db with the code i have?   #include <stdio

Computer Science Feb 13, 2023

Sqlite with C language(just C, not C++ or anthing else)

 

how can i insert data into the database with C language after i open my db with the code i have?

 

#include <stdio.h>
#include <sqlite3.h>
int main(int argc, char* argv[]) {
sqlite3* db;
int c;

int pick;
c = sqlite3_open_v2("Data.db", &db, SQLITE_OPEN_READWRITE, NULL);
if(c != SQLITE_OK) {
printf("Can not open database! %sn", sqlite3_errmsg(db));
return(0);
} else {
printf("Connect to database successfully.n");
}

printf("Welcome to the Data application:n 0)Exitn 1)Add a new Stuff");
scanf("%d", pick );

if(pick==1){

//how to do it?

//Stuff is the table which has 2 attributes,  Id is PK,  Name is UK(unique key)

 

}

if(pick ==0){
sqlite3_close(db);}

Expert Solution

For detailed step-by-step solution, place custom order now.
Need this Answer?

This solution is not in the archive yet. Hire an expert to solve it for you.

Get a Quote
Secure Payment