|
Re: MySQL dll
[Re: Excessus]
#41709
10/13/05 00:46
10/13/05 00:46
|
Joined: Oct 2005
Posts: 11
Remo_L
Newbie
|
Newbie
Joined: Oct 2005
Posts: 11
|
Im having a little trouble getting these plugin to work . I have the dll files (both) in both folders (a plug ins and my project folder). First I tried it without loading anything but declaring the functions and it didnt work. Then I tried loading the DLL manually in the bottom of Main and it says that this is not a valid acknex dll plug-in. Anyone knows why am I getting that error?
|
|
|
Re: MySQL dll
[Re: Remo_L]
#41710
10/17/05 06:48
10/17/05 06:48
|
Joined: Aug 2005
Posts: 343 Germany
HPW
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 343
Germany
|
Don't forget to open the incomming ports for MySql(Port number: 3306) to connect to a database on a Server OS!
Evil Blood (v. 0.52) RPG Commport.de (Social Network Community)
|
|
|
Re: MySQL dll
[Re: KyiasShadow]
#41711
11/26/05 04:10
11/26/05 04:10
|
Joined: Sep 2005
Posts: 514 USA
Gho5tFac3K1llah
Developer
|
Developer
Joined: Sep 2005
Posts: 514
USA
|
Quote:
//LOGIN STERINGS string Login_Query; // holds the mysql query string username[16]; // holds the username string password; // holds the password string libmysqldll = <libmysql.dll>; var_nsave mysql_handle;
I understand this.
Quote:
Then Code:
//////////////////// //DATABASE FUNCTIONS dllfunction mySQL_Connectdb(w,x,y,z); dllfunction mySQL_Closedb(); dllfunction mySQL_ExecQuery(string); dllfunction mySQL_GetVal(x,y); dllfunction mySQL_GetStr(string,x,y); dllfunction mySQL_RowNumber(); dllfunction mySQL_IsConnected();
After this i have all of my panels/texts that are in the login script. have you added functions to these to handle the login scripts wich mine will be below.
Code:
//////////////////// //TEXT'S text txtName { pos_x = 575; pos_y = 115; layer = 30; font fnt_century12; string username; } text txtPassword { pos_x = 575; pos_y = 115; layer = 30; font fnt_century12; string password;
I understand all that also. What I do not understand is this:
Quote:
Now for what is in my function Main. Code:
//Main Function function main() { mouse_on(); level_load(MPLevel); //Load the first level sleep(.2); While (!bat_set) { wait(1); } mysql_handle = dll_open(libmysqldll); mySQL_Connectdb("databse","host","user","password"); }
What is the mySQL_Connectdb("databse","host","user","password"); mean? Do I leave it as it is or do I fill in that info.
Quote:
Ok now i have a buttony ou push then a login apears. within this is the login script that i use for the 2 Textxs that were showsn earlier. Code:
mySQL_Connectdb("databse","host","user","password"); if(!mySQL_IsConnected()&&!mySQL_Connectdb("databse","host","user","password")) { beep; exit; } txtName.visible = on; inkey(username); txtName.visible = off; txtPassword.visible = on; inkey(password); txtPassword.visible = off;
str_cat(Login_Query, "select * from Accounts WHERE Account_Name='"); str_cat(Login_Query, username); str_cat(Login_Query, "' AND Password='"); str_cat(Login_Query, password); str_cat(Login_Query, "';"); mySQL_ExecQuery(Login_Query); if(mySQL_ExecQuery(Login_Query)&&mySQL_RowNumber()==1) { Join_Game(); } else { beep; exit;//if no entry, exit }
All I ask from you, KyiasShadow, is that you go into more detail for people, like me, who do not fully understand this. Cheers.
Domingo
|
|
|
Re: MySQL dll
[Re: Gho5tFac3K1llah]
#41712
11/26/05 11:16
11/26/05 11:16
|
Joined: Jan 2005
Posts: 1,918 BagEnd, Hobbiton, The Shire, E...
Bilbo
Senior Developer
|
Senior Developer
Joined: Jan 2005
Posts: 1,918
BagEnd, Hobbiton, The Shire, E...
|
What is the mySQL_Connectdb("databse","host","user","password"); mean? Do I leave it as it is or do I fill in that info.
-i can answer this question, you have to fill in your details host is usually localhost
|
|
|
Re: MySQL dll
[Re: Gho5tFac3K1llah]
#41714
01/17/06 03:52
01/17/06 03:52
|
Joined: Jun 2001
Posts: 385 Eastern Washington State
Zio
Senior Member
|
Senior Member
Joined: Jun 2001
Posts: 385
Eastern Washington State
|
This has to be the strangest bug I've run across. I've been using the mySQL dll and it's been working beautifully. However I can't figure out why this is happening, it makes no sense. I'm trying to fill up a text object with a list of the currently online users. You would think this this code would work: Code:
while(line < users) { mySQL_GetStr(txtOnlineUsers.string[line],0,line); line += 1; }
However that prints out the same username on every line of text. Sort of. It's hard to describe, but it basically does this: The first line prints the correct name. The second line prints the correct name, but also overwrites the first line with the second name. Etc etc. The end result is that every line contains the last name pulled. But that isn't the strange part. Trying to debug the code, I tested out this snippet instead of the loop: Code:
mySQL_GetStr(txtOnlineUsers.string[line],0,line); line += 1; mySQL_GetStr(txtOnlineUsers.string[line],0,line); line += 1; mySQL_GetStr(txtOnlineUsers.string[line],0,line); line += 1; mySQL_GetStr(txtOnlineUsers.string[line],0,line); line += 1; //etc etc
THAT works PERFECT. How is that any different than what the loop is doing?! I seriously can't figure it out. EDIT:Hmm, did a bunch more tests and the problem is completely unrelated to pulling the string with mySQL_getStr(), so this doesn't really belong in the thread. That's what I get for being impatient and posting before exhausting all possible tests.
Last edited by Zio; 01/17/06 04:31.
|
|
|
|