Author Topic: Best Choice for Connecting to PHP/MySQL from a .cpp?  (Read 14379 times)

Offline LinuxOwner

  • Single posting newcomer
  • *
  • Posts: 8
Best Choice for Connecting to PHP/MySQL from a .cpp?
« on: January 26, 2012, 01:54:45 pm »
Yes. I'm new, however, I still request input!
Details:
1. I use Ubuntu 10.10, I am starting to code in C++ (hence the Code::Blocks).
2. My App is going to need to connect to MySQL db.
3.Concern: Should I use my app to connect to a PHP file first, (security reasons?) or am I safe to go straight from C++ app to the MySQL DB?
4.Does the Code::Blocks have all the features needed for this mission, right out of the box?

Thx All.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #1 on: January 26, 2012, 02:00:39 pm »
This is NOT a programing help site!

I have NO idea what features are needed you never stated any!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline LinuxOwner

  • Single posting newcomer
  • *
  • Posts: 8
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #2 on: January 26, 2012, 02:03:35 pm »
That would be why I did not ask "how to do" anything..
I merely asked if Code::Blocks was capable of accomplishing this feat out of the box.
Thanks for the nice welcome.
Is there anyone else who would care to share something other than negativity?
Thx (again)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #3 on: January 26, 2012, 02:41:22 pm »
That would be why I did not ask "how to do" anything..
I merely asked if Code::Blocks was capable of accomplishing this feat out of the box.
Thanks for the nice welcome.
Is there anyone else who would care to share something other than negativity?
Thx (again)
If you mean, if there is a MySQL wizard, no, as far a s I know there is not. At least not in standard C::B.

Nevertheless C::B can be used to do this and there are some C::B and MySQL tutorials in the web, a simple google for codeblocks and mysql gives me more than 500000 answers.
I did not test any of them, so I don't know, if any of them work.

Offline LinuxOwner

  • Single posting newcomer
  • *
  • Posts: 8
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #4 on: January 26, 2012, 02:51:38 pm »
Jens.

Ty for your response.

I am currently doing what you suggest, (Googling) as we speak.
perhaps, I need to refine my question.

Does Code::Blocks out of the box, (meaning without adding any extras) just the plain install, possess the capability of:
Programming a C++ App which can connect to a PHP file or directly to a MySQL Server db?
 
Thank you for everyone's patience with this complicated question.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #5 on: January 26, 2012, 04:04:24 pm »
Code::Blocks is a IDE that works with several different Compilers!

Does the compiler you wish to use able to do what you want?
Is the compiler supported by Code::Blocks?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline LinuxOwner

  • Single posting newcomer
  • *
  • Posts: 8
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #6 on: January 26, 2012, 05:50:09 pm »
Code::Blocks is a IDE that works with several different Compilers!

Does the compiler you wish to use able to do what you want?
Is the compiler supported by Code::Blocks?

Tim S.

Tim,

I was thinking that CODE::Blocks uses its own built in compiler. I thought it is the GCC compiler. This is why I was asking the original question about wanting to use CODE::Blocks to create my C++ app. It was my understanding that I code the program, I select build and run, and the program would compile. Seemed rather simple. I was just wondering if there was something (in addition to the installation of Code:Block software) I would need to create an app which can connect to a MySQL database.

Truly, I apologize if it seems a rather simplistic question to anyone else. The one saving grace is that I KNOW I don't know what I'm talking about, that's why I am here seeking advice. Thanks to those of you who have helped.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #7 on: January 26, 2012, 06:03:50 pm »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline LinuxOwner

  • Single posting newcomer
  • *
  • Posts: 8
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #8 on: January 26, 2012, 06:20:04 pm »
Thanks?

Why have Forums? I'm sure that anyone can answer a question with "read these please":
www.google.com
www.mysql.com
and
www.cprogramming.com
or whatever.

I'm looking for a "Yes this should be all you need, or a NO, there are additional requirements and you might want to start by looking into (XYZ)."

I'm close to 40 years old with a full time job and do not have the Time nor luxury of reading every written documentation know to mankind to get a simple answer. I was rather hoping users here would help in the sake of time management rather than waste it. Unfortunately it seems as though people are more interested in playing Forum police and treating me as if I'm a child doing homework. For those of you who are actually interested in helping someone with the answer, UNCONDITIONALLY... please feel free to post. Anyone else, unless you are offering something other than more wasted time, please don't bother to comment.

Thank you to those users who see my point.

regards.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #9 on: January 26, 2012, 06:23:32 pm »
CODE::BLOCKS IS NOT A COMPILER; YOUR QUESTION IS 99% RELATED TO THE COMPILER.

Read the rules; http://forums.codeblocks.org/index.php/topic,9996.0.html

Tim S.

PS: When did Linux owners become as lazy as the Windows owners?

« Last Edit: January 26, 2012, 06:29:33 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline LinuxOwner

  • Single posting newcomer
  • *
  • Posts: 8
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #10 on: January 26, 2012, 06:36:48 pm »
Ty for the answer (other than the inference of being lazy and the SHOUTING in caps) as I did not in any way disrespect ANYONE here.

My lazy linux using self will now take the TIME to thank you for clarifying that C::B is NOT a compiler.
I will make also make TIME to offer guidance to the next user when He/She is unclear about whether or not Code:Blocks is a Compiler or not.
See? Your assistance did not go in vain. It's the least I can do.

Thanks 'gain, Tim.

I don't see that I am the one who can mark this as [RESOLVED], but I do believe this thread can be closed.


Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #11 on: January 26, 2012, 09:31:10 pm »
3.Concern: Should I use my app to connect to a PHP file first, (security reasons?) or am I safe to go straight from C++ app to the MySQL DB?
For a good answer to this, you will probably need to seek out an SQL forum.  (Although, as a general rule, I would take the shortest path - go directly - as it is in general less work and more efficient.)

4.Does the Code::Blocks have all the features needed for this mission, right out of the box?
Yes and no.
Yes: it comes with every thing it is meant to/should have.
No: Batteries not included.  You will either need to link directly with the development libraries of your SQL engine (which will need to be installed if they are not already); or use a wrapper interface (generally these are nicer to work with than the base library) like MySQL++.  If you need an example of how to setup search paths and link libs, examine a project produced by one of Code::Blocks' wizards (for example, wxWidgets).

LinuxOwner: be aware that the rather heated responses are a result of being asked nearly the same question very many times (hence the multiple links to the FAQ).

Offline LinuxOwner

  • Single posting newcomer
  • *
  • Posts: 8
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #12 on: January 26, 2012, 09:44:39 pm »
Alpha,

Thank you so much. This is exactly what I have been looking for.  I cannot emphasize how much of an assistance this is. I understand they (whomever) may have heated responses for being asked a question numerous times. I will gladly excuse the rudeness as long as I am shown the same latitude for having to ask the same question over and over in Google and other places. It can be frustrating trying to ask questions about something when one is not really sure what in fact is the correct way to ask. Additionally, I was not forcing anyone to ANSWER my post, it was just simply there if some fine person like yourself were to accommodate my request. I guess that is how I thought forums worked.

Honestly, I had pretty much written this thread off as closed, but with the addition of your info, this will probably help someone else (me too) with some valuable info. Again Ty.

Cordially,

LinOwn

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #13 on: January 26, 2012, 11:43:37 pm »
FYI: Learn how to ask a smart question in the right forum!!
This web-site DOES NOT teach programming or how to use your compiler!!

http://catb.org/esr/faqs/smart-questions.html#forum
Quote
Be sensitive in choosing where you ask your question. You are likely to be ignored, or written off as a loser, if you:

    post your question to a forum where it's off topic

Tim S.
« Last Edit: January 26, 2012, 11:45:45 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Best Choice for Connecting to PHP/MySQL from a .cpp?
« Reply #14 on: January 27, 2012, 12:01:56 am »
LinuxOwner: be aware that the rather heated responses are a result of being asked nearly the same question very many times (hence the multiple links to the FAQ).

This is the result of the OP not being able to understand that his question IS NOT related to Code::Blocks!
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org