I have some data in a table in mysql.
I have written a program which can connect to the database and access all tables and data of mysql.
I have a variable in the C program. I want a particular data in one of the tables in the database to be stored in this variable...
can someone tell me how to retrieve this data and store it into the variable for some processing???
akand
0
Newbie Poster
Recommended Answers
Jump to PostDo you know SQL? If not then you will have to read an SQL tutorial There is no one-line C solution for your question.
Jump to PostFirst write the select statememnt
SELECT * FROM Books WHERE Number = 123 // or whatever number you want
Put that into a string and pass the string to the query statement function. When that function returns your program will have to loop through the MySQL's result …
Jump to PostSorry dude! but i don't know anything about SQL....
Well, see that's the problem. If you want to work with MySQL then you will have to learn SQL, or at least the basics.
Jump to PostQuote originally posted by lionaneesh ...
Sorry dude! but i don't know anything about SQL....
Well, see that's the problem. If you want to work with MySQL then you will have to learn SQL, or at least the basics.He is not the OP.
akand, Ancient Dragon is right …
Jump to Post...For doing the mathematical operation I need to extract d data from d table and STORE it in another variable in d C program....
my doubt was how to initialise a variable in a C program wid a data from a table...thts all...Sorry, I didn't notice those questions earlier. …
All 24 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
lionaneesh
-4
Junior Poster
akand
0
Newbie Poster
lionaneesh
-4
Junior Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
nbaztec
45
Posting Pro in Training
tesuji
135
Master Poster
nbaztec
45
Posting Pro in Training
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
nbaztec
45
Posting Pro in Training
tesuji
135
Master Poster
nbaztec
45
Posting Pro in Training
akand
0
Newbie Poster
akand
0
Newbie Poster
akand
0
Newbie Poster
nbaztec
45
Posting Pro in Training
akand
0
Newbie Poster
akand
0
Newbie Poster
tesuji
135
Master Poster
nbaztec
45
Posting Pro in Training
tesuji
135
Master Poster
nbaztec
45
Posting Pro in Training
tesuji
135
Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.