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.

  • 2
    Welcome! I don't know how, but please show the code that you have tried, a simple [Minimal Reproducible Example](https://stackoverflow.com/help/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](https://stackoverflow.com/tour) and read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) – Weather Vane Jul 02 '23 at 20:45
  • thank you for the advice, i've modified the question, hope now it's more clear – Davide Mazzarotto Jul 03 '23 at 10:29
  • Please *read* the links provided for you! – Weather Vane Jul 03 '23 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. – Davide Mazzarotto Jul 03 '23 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. – Weather Vane Jul 03 '23 at 10:44
  • I'm sorry I couldn't find a way to make a concrete example, I'll try other methods, but still thanks for all the helpful advice you gave me – Davide Mazzarotto Jul 04 '23 at 09:56

0 Answers0