First define the function:
Code:
 
//--------------------------------------------------------------------
// DLL-declarations
//--------------------------------------------------------------------
dllfunction mySQL_Connectdb(w,x,y,z); // declaration of a DLL function
dllfunction mySQL_Closedb();
dllfunction mySQL_ExecQuery(string);
dllfunction mySQL_GetVal(x,y);
dllfunction mySQL_GetStr(string,x,y);
dllfunction mySQL_RowNumber();
dllfunction mySQL_IsConnected();



Then you can connect to the database with this little piece of code:
Code:
 mySQL_Connectdb("database","localhost","username","password") 


Change the database, localhost, username and password to your own.

Then you can execute a normal mysql query with mySQL_ExecQuery('query');
(there are tons of tutorials explaining this on the internet).

Now it's time to look at the information using either:
Code:
 
mySQL_GetVal(x, y); // gets the var value of the position x,y in the returned data
mySQL_GetStr(string, x, y); // assigns the value of x,y to the string string



Hope this helped a bit.