Solved

MySQL and FreePascal

Posted on 1998-08-18
3
781 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
ID: 1025553
'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
ID: 1025554
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
ID: 1025555
Thanks jconde

--jc
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

786 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