KDevelop with MySQL

Dave Robbins dmrobbin at mindspring.com
Tue Nov 16 09:52:06 GMT 1999


Hi Jean Paul,

I just happen to be doing the same thing (using MySQL with KDevelop)
I got the newest version of MySQL from www.mysql.net, version 3.22
I got 3 rpm's, the database, the clients and the development rpm
installed with no problem on RH 6.0
in KDevelop, under "Project/Options/Linker Options" I added
"-L/usr/lib/mysgl -l/mysqlclient"
after this I just "include <mysql/mysql.h>" in the doc class header file
and everthing is ready to go
like kenny suggested, I used kmysql to create a new table I called
"data". you could do this from the command line
The rpm's contained the manuals for MySQL and I pieced together this
code from the docs

        //setup the database connection
        MYSQL mysql;
        mysql_init(&mysql);

        if(!mysql_real_connect(&mysql, "129.138.0.3", "dmrobbin", NULL,
"test", 0, NULL, 0))
        {
        fprintf(stderr, "Failed to connect to database: Error: %s\n",
mysql_error(&mysql));
        };

        if(mysql_query(&mysql, "load data local infile
\"/tmp/output.txt\" into table data"))
  {
        fprintf(stderr, "Failed to connect to database: Error: %s\n",
mysql_error(&mysql));
        };

//      if(mysql_query(&mysql, "insert into data values
('nov99','put',1295,12.35,43.21)"))
////  {
 //     fprintf(stderr, "Failed to connect to database: Error: %s\n",
mysql_error(&mysql));
//      };

the  two msql_query statements put data into the table I created so they
are specific to my table

The docs are pretty extensive, I'm still trying to digest them
the docs to all the API calls are at the end of the documentation
let me know if I can help you out

Dave

"Kenny G. Dubuisson, Jr." wrote:

> Try checking out KMySql at http://www.xnot.com/kmysql/.  Though, from
> what I can tell, it was not developed using KDevelop, it would give
> you a head start.  I would suggest contacting the authors to see if
> you could work together so that you would get the functions you need
> to write your accounting app, and KMySql would get the benefit of
> having an accounting app on its resume.Just a thought.  Hope it
> helpsKenny Dubuisson, Jr.Jackson, Mississippi, USA-----Original
> Message-----
> From: Mailing list agent [mailto:mdom at barney.cs.uni-potsdam.de]On
> Behalf Of Jean-Paul Miniscloux
> Sent: Friday, November 12, 1999 10:58 AM
> To: kdevelop at barney.cs.uni-potsdam.de
> Subject: KDevelop with MySQL
>
>
>      Hello, Someone among you, does he have used KDevelop with
>      MySQL? I am busy to write a software of accounting and I
>      will like used the databases under MySQL.
>      I installed MySQL therefore since some RPM files, but I
>      don't know how use the library. If I have well understood
>      the documentation, it is necessary that the program includes
>      in client. That I must to put in the profile of project and
>      which is the includes has to indicate. Thank you Jean Paul
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/19991116/f490a03d/attachment.html>


More information about the KDevelop mailing list