Solved

MySQL and FreePascal

Posted on 1998-08-18
3
759 Views
Last Modified: 2012-06-21
Hi, can some one tell me what the parameters are to connect to
a database using libmysql.a?
0
Comment
Question by:jcarlos2
3 Comments
 
LVL 2

Expert Comment

by:gravity
Comment Utility
'frais not... but, could you help with my quest for a MySQL area in Experts Exchange by posting a new topic suggestion?

Thanks,
Tom
0
 
LVL 7

Accepted Solution

by:
jconde earned 200 total points
Comment Utility
It's very simple JCarlos2.  All you need to do is the following:

 sock :=  mysql_connect(PMysql(@qmysql),'hostname','username','password');
  if sock=Nil then
    begin
    Writeln (stderr,'Couldn''t connect to MySQL.');
    Writeln (stderr,mysql_error(@qmysql));
    halt(1);
    end;
{Connected!}

where sock is an Integer, pmysql() is a pointer to mysql and mysql is
the structure record.

--jconde
0
 

Author Comment

by:jcarlos2
Comment Utility
Thanks jconde

--jc
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article describes some very basic things about SQL Server filegroups.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now