0

i'm trying to send queries from a C program using the sqltools extension in vs code, which i have already connected to my mysql database on xampp, but i can't find any way to send queries directly from the C program and not from the extension's .sql file.

for example, this is the code on the .sql file

INSERT INTO table_name (colum)
VALUES (some_data);

and I would like to turn it into a C function like this one

void storing_data_function (table, colum, data){
    //puts the data into the colum of the table in my database
}

any idea what should i do? I'm not very good at this stuff so if I made any rookie mistakes I strongly apologize.

6
  • 2
    Welcome! I don't know how, but please show the code that you have tried, a simple Minimal Reproducible Example, the shortest complete code that shows the problem. And post the inputs, the expected output and the actual output. May I suggest you take the Tour and read How do I ask a good question? Commented Jul 2, 2023 at 20:45
  • thank you for the advice, i've modified the question, hope now it's more clear Commented Jul 3, 2023 at 10:29
  • Please read the links provided for you! Commented Jul 3, 2023 at 10:31
  • I did, I researched the question but I didn't find any documentation, I didn't find other similar questions posted here and I tried to be as clear and concise as possible. the only thing I can't figure out is a good reproducible example, mostly because it's a very specific problem that I don't know much about and that no one else seems to have tackled. Commented Jul 3, 2023 at 10:40
  • A miminum example would contain #include headers, and a main() function that does the simplest possible job. If you are unsure what to do, this should be your approach anyway - divorced from anything else you are trying to do. Commented Jul 3, 2023 at 10:44

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.