building mySQL API for UScript need help.

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Qjahe

New Member
Nov 15, 2003
36
0
0
Hi,

i've been looking all over for some information on how to have UScript connect and select/insert records from a mySQL server, and couldn't find anything anywhere. So I am going to attempt to do the API myself.

I was wondering if I could just somehow import mysql.h from mysql in one of my classes? Couldn't be that easy?

In last resort i'm thinking of subclassing the UBrowserBufferedTCPLink and going from there to connect to the mysql server.

I am not sure how mySQL is expecting a connection tho?
Do I just open a TCP socket on the right port and then send SQL queries and wait for the answer?

Anyone has any usefull info on this?

Thanks

Qjahe
 
Last edited:

pjmodos

New Member
Sep 28, 2001
7
0
0
42
www.parba.cz
Why not?
I made direct interface to postgresql and it wasn't so hard (yes it's limited but it does what i needed).
I dunno about mysql but it shouldn't be problem, you just need to learn it's raw protocol.
 

Qjahe

New Member
Nov 15, 2003
36
0
0
hmmm

pjmodos said:
Why not?
I made direct interface to postgresql and it wasn't so hard (yes it's limited but it does what i needed).
I dunno about mysql but it shouldn't be problem, you just need to learn it's raw protocol.

You think it'll be faster to connect directly to mySQL server?
How do you manage to keep your DB login / pwd hidden?

COuld I see a sample of your code?

Thanks for the info...

Qjahe
 

elmuerte

Master of Science
Jan 25, 2000
1,936
0
36
43
the Netherlands
elmuerte.com
direct access to a database has a couple issues much depending on the "what" of the thing you are going to do.

the most important one it the security.
usually you configure your database servr to only allow connections from a localhost.
another very important issue is the compatibility, unless it's for private use only, you can guarantee that the user has access to the right DBMS.