Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, AndrewAMD), 877 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 9 of 24 1 2 7 8 9 10 11 23 24
Re: MySQL dll [Re: Leonardo] #41697
07/25/05 09:05
07/25/05 09:05
Joined: Feb 2004
Posts: 174
Somwhere looking for plants
D
Destop Offline OP
Member
Destop  Offline OP
Member
D

Joined: Feb 2004
Posts: 174
Somwhere looking for plants
I ll post a quick example of how to retreive data from MySQL using the plug-in to help you all!
I dont know why I didnt put a tutorial in it at first, but I ll do it.

Re: MySQL dll [Re: Destop] #41698
08/06/05 23:06
08/06/05 23:06
Joined: Jun 2004
Posts: 655
to your left
BoH_Havoc Offline
User
BoH_Havoc  Offline
User

Joined: Jun 2004
Posts: 655
to your left
I have a question concerning mySQL_GetVal(x, y)

Quote:

Return the value of the numeric field x at the line y of the resultset




err... how can i set the resultset?
At the moment, everytime i call that function, i get a crash in mySQL_GetVal ... which is logical as no resultset is set.


and just as a side note: your dll really kicks ass! good job!

[edit]

here's my code

Code:
function mySQL_read_position
{
mySQL_ExecQuery("USE test");
mySQL_ExecQuery("SELECT * FROM position");
temp = mySQL_GetVal(1,1);
if (temp > 0)
{
msg_show("mySQL data read!");
}
if (temp == 0)
{
msg_show("mySQL data does not exist!");
}
if (temp == -1)
{
msg_show("not a numeric field!");
}
}



this leads to "crash in mySQL_GetVal: waitt(secs*16)" .
so what needs to be changed?

[edit2]
well, as this is really important for me (mySQL is the heart of my game. Without it, the game is technically not possible) here's some candy for you: the person that helps me out gets this model-/texturepack:
http://projecthavoc.pr.funpic.de/gallery/sci-fi-pack/

you can do everything with the pack you want. change it, sell it, burn it ... it's up to you

Last edited by BoH_Havoc; 08/07/05 18:40.

Shade-C EVO Lite-C Shader Framework
Re: MySQL dll [Re: BoH_Havoc] #41699
08/09/05 15:31
08/09/05 15:31
Joined: Jun 2004
Posts: 655
to your left
BoH_Havoc Offline
User
BoH_Havoc  Offline
User

Joined: Jun 2004
Posts: 655
to your left
c'mon guys, i can't belive that there's nobody who can tell me how to set the resultset.
*falls on his knees* pleeeease


Shade-C EVO Lite-C Shader Framework
Re: MySQL dll [Re: BoH_Havoc] #41700
08/09/05 21:45
08/09/05 21:45
Joined: Mar 2004
Posts: 217
UK (Peterborough)
KyiasShadow Offline
Member
KyiasShadow  Offline
Member

Joined: Mar 2004
Posts: 217
UK (Peterborough)
HAvent used it yet so i dont know mate sorry.


A6 Commercial V6.3 1024MB DDR RAM P4 2.8GHz 256MB GeForce FX 5600 160GB HDD
Re: MySQL dll [Re: KyiasShadow] #41701
08/10/05 20:19
08/10/05 20:19
Joined: Jun 2004
Posts: 655
to your left
BoH_Havoc Offline
User
BoH_Havoc  Offline
User

Joined: Jun 2004
Posts: 655
to your left
omg i'm such a dumbass xD
have a look at this line:

msg_show("mySQL data read!");

now what's wrong about it?
I FORGOT TO SET THE TIME THE MSG IS SHOWN! OMG xD

-> msg_show("mySQL data read!",10);

=> everything works fine! no more errors!

PS: you are allowed to laugh


Shade-C EVO Lite-C Shader Framework
Re: MySQL dll [Re: BoH_Havoc] #41702
08/11/05 13:51
08/11/05 13:51
Joined: Mar 2004
Posts: 217
UK (Peterborough)
KyiasShadow Offline
Member
KyiasShadow  Offline
Member

Joined: Mar 2004
Posts: 217
UK (Peterborough)
LMFAO io didnt even look at your script either. Its always best to make sure you like check it and keep checking it.


A6 Commercial V6.3 1024MB DDR RAM P4 2.8GHz 256MB GeForce FX 5600 160GB HDD
Re: MySQL dll [Re: KyiasShadow] #41703
08/17/05 02:59
08/17/05 02:59
Joined: Aug 2002
Posts: 44
Panama City, FL
S
Specterdragon Offline
Newbie
Specterdragon  Offline
Newbie
S

Joined: Aug 2002
Posts: 44
Panama City, FL
OK.. have to finally chime in... I managed to connect the DB without any problems... heres my code snippit:

Code:


str_cpy(test_text.string[1], "Connecting to DB");
sleep(1);

var hr;
hr = mySQL_Connectdb("dbname","localhost","root","password");
if(hr == 1)
{
str_cpy(test_text.string[1], "DB is connected and online");
sleep(1);
mySQL_ExecQuery("use table01;");
}
else
{
str_cpy(test_text.string[1], "DB failed to connect");
sleep(5);
exit;
}

// get an entry from the DB
str_cpy(test_text.string[1], "Performing query");
sleep(1);
hr = mySQL_ExecQuery("select * from table01 where name='index';");
str_cpy(test_text.string[1], "Aquiring result");
sleep(1);
mySQL_GetStr(test_text.string[2],0,0);




At the moment, it crashes when I make the mySQL_GetStr(test_text.string[2],0,0); call.

test_text is a text object just for displaying some results and includes a couple of strings. Everything works up untill I try to extraxt info from the resultset (which I'm assuming is being returned as part of the query?). I've tried using 0, 1, and mySQL_RowNumber() for the third peram... Since 'index' is the first field in the DB row, I expected it to return exactly what I put out to the query.

So, the question is... now that I can connect, and seemingly access the table... how do I extract info from the DB?


Just thinking out loud, Specterdragon
Re: MySQL dll [Re: Specterdragon] #41704
08/17/05 09:30
08/17/05 09:30
Joined: Feb 2004
Posts: 174
Somwhere looking for plants
D
Destop Offline OP
Member
Destop  Offline OP
Member
D

Joined: Feb 2004
Posts: 174
Somwhere looking for plants
I am back from holidays!
I ll try to dig in my old computer for the example file I used to make test whyle developping! (gave a quick try this morning, but I couldnt find it)
Destop

Re: MySQL dll [Re: Specterdragon] #41705
08/18/05 01:56
08/18/05 01:56
Joined: Aug 2002
Posts: 44
Panama City, FL
S
Specterdragon Offline
Newbie
Specterdragon  Offline
Newbie
S

Joined: Aug 2002
Posts: 44
Panama City, FL
Well.. well... in the ancient language:
"Owa tafoo lyam!"

I see the error.. and it seems to be working now

Code:

hr = mySQL_Connectdb("dbname","localhost","root","password");
if(hr == 1)
{
str_cpy(test_text.string[1], "DB is connected and online");
sleep(1);
mySQL_ExecQuery("use table01;");
}


I changed to a non-existant DB with a "use" query (thinking it was for switching from one table to another) LOL... ok.. ok... laugh now... I'm an SQL newbie

Would be nice if there was a simpler form of array gathering.. hemm... perhaps a wrapper <include> for use with 3DGS... I'll have to work on that..

Two questions for the gurus:
1> Can you perform ANY query that MySQL can understand? I know (from tutorials) that the query can get pretty long and complicated. Unfortunatly, I dont have a complex database (yet) to test that out on.
2> How do you connect this to an off-site DB (i.e. over the net)? I figured that the MySQL server has to be running, and rumor is that I would have to upgrade to pro (which I'm considering doing anyhow), but what would I replace "localhost" with in order to get across the net?


Just thinking out loud, Specterdragon
Re: MySQL dll [Re: Specterdragon] #41706
08/18/05 11:49
08/18/05 11:49
Joined: Jun 2004
Posts: 655
to your left
BoH_Havoc Offline
User
BoH_Havoc  Offline
User

Joined: Jun 2004
Posts: 655
to your left
1:
dunno, haven't tested it myself yet. But i don't see a problem here.

2:
I have COM and connecting to a database through the internet works great (if not to say fantastic ^^).
To connect to an "off-site db" (as you name it) change "localhost" to "my-rootserver.ath.cx" (which points to your rootserver's ip. check out http://www.dyndns.org for more info). Instead of my-rootserver.ath.cx you could also write your rootserver's public ip (e.g. 173.16.232.85).
If you don't have a rootserver but webspace with a db then you have to ask your webspace-provider what your db's pub ip/rootdir is. That should also work (haven't tested it myself as i "only" have a rootserver )

Hope that helps you out


Shade-C EVO Lite-C Shader Framework
Page 9 of 24 1 2 7 8 9 10 11 23 24

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1