Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How Do I Send Data To a MySQL Database?

Author
Message
Heey
15
Years of Service
User Offline
Joined: 7th Nov 2010
Location:
Posted: 8th Nov 2010 03:34
Okay, so I'm probably going to get DarkBasic Pro, and DarkData. I want to know, how would I send data to a MySQL database on a website?
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 8th Nov 2010 16:41
Without knowing what you plan to do, that could be overkill, what is it you're using MySQL for?

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 8th Nov 2010 17:27 Edited at: 8th Nov 2010 17:28
DBConn - A DarkBASIC Professional plugin that allows access to any ODBC datasource.

http://www.kistech.com/page.php?15

However, it may still be overkill depending on what you're trying to do with it..

Devonps
16
Years of Service
User Offline
Joined: 5th Nov 2009
Location: Nottingham
Posted: 8th Nov 2010 18:27
Isn't Dark Data supposed to take the place of a database such as MYSQL?

Marriage is a circle of rings....
Engagement ring, Wedding ring, Suffering!
GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 8th Nov 2010 19:57
DBConn is awesome, been using it for a small program I wrote and it works wonders.

BTW KISTech, Did you ever get around to fixing the problem with the Error command? Once DBError() returns an error string, it keeps returning the same string every time its called. I would think it would reset automatically, or have a seperate command to reset it. I have code in place to deal with errors should they occur, but without DBError() resetting it is hard to tell what commands errored out and which ones didn't.

To add to the conversation thus far, he did mention "website". My guess is his program and website share the same SQL database, as does my own. Dark Data's database would not be easily accessed by a website.

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 8th Nov 2010 20:11
I haven't actually had the time to check into that issue.

Although I think my thought process at the time was, the error message would only be updated if there were an error condition to check, so when one of the other commands indicates an error occurred the DBError text should be updated with the most recent error.

I'll see if I can fix that during the next few months though. I'm about neck deep in 6 projects right now, both programming and not..

Heey
15
Years of Service
User Offline
Joined: 7th Nov 2010
Location:
Posted: 9th Nov 2010 00:04
Okay, so I want to have an online game, and keep track of their items, their last position when they logged off, being able to interact with each other. Actually what add-on would be good for that, Dark Net, Dark Data, or both? If so, please do elaborate on how. Also, I want to spend money the least I can.
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Nov 2010 00:25
You need network connectivity, possibly using DarkNet

Your database connectivity will all be handled on the server, not in DBP. That is, you send data and requests for data to the server, it in turn is connected to the database and performs all the required SQL.

Heey
15
Years of Service
User Offline
Joined: 7th Nov 2010
Location:
Posted: 9th Nov 2010 00:55
How would one set up a server - at the cheapest?
Heey
15
Years of Service
User Offline
Joined: 7th Nov 2010
Location:
Posted: 9th Nov 2010 02:06
How would one set up a server for this?
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 9th Nov 2010 16:35
Google 'Virtual Private Server'

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 9th Nov 2010 18:56
From the questions you are asking, and what little information you've given so far, I'm guessing you are wanting to make some kind of MMO.

Don't buy anything yet.

Share the full idea here, and let us help you understand everything that is required for it. Because it sounds like you're pretty new to all of this. The last thing we want to see is someone spend money on something that they wont be able to use.

The idea itself doesn't matter. Don't worry about someone stealing it, and going off and making your game. Chances are it's already been done in one form or another, and even if it hasn't, it takes years to make a good game from an idea.

So lay it all out and let us know what you have in mind, so we can help you better.

Heey
15
Years of Service
User Offline
Joined: 7th Nov 2010
Location:
Posted: 10th Nov 2010 00:10
Here's it in a nutshell. You're a character (of course), you have weapons such as a sniper. You can mine. You can drive vehicles, you can chat. All of that. Understand?
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 10th Nov 2010 18:03
How many players do you intend to support at once?

Are there going to be separate maps, or one big game world?

What I'm getting at here is, is it an MMORPG (500 players or more) or is it a Multiplayer RPG with support for a limited number of players in game at once? ( less than 100 )

The difference being if it's an MMORPG, you're going to need more power than DBPro is likely going to be able to provide. C++ with DarkGDK would be a better choice. (as I have learned from experience..)

DBPro is a very capable development environment, but it does have it's limits. See Worlds Apart Online to see DBPro running at very near some of those limits. I'm currently in the process of rewriting it in C++ w/DarkGDK.

Programs written in C++ using DarkGDK have been shown to run anywhere from 4 to 10 times faster than the same DBPro program. For an MMO of any kind, you'll need that extra power.

DarkGDK is also Free. You don't have to buy the license unless you release a commercial product with it.

Devonps
16
Years of Service
User Offline
Joined: 5th Nov 2009
Location: Nottingham
Posted: 10th Nov 2010 18:51
You could have a look at The World of Omen thread for ideas/inspiration.

Marriage is a circle of rings....
Engagement ring, Wedding ring, Suffering!
Heey
15
Years of Service
User Offline
Joined: 7th Nov 2010
Location:
Posted: 12th Nov 2010 04:22
Yeah okay. Let's say (in theory) I already have an old computer, and I have Dark Basic and Dark Net. How would I use that for a small persay ~500 player RPG?
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 12th Nov 2010 18:38
DBPro might be able to handle 50 players, or it might be able to handle 500. It depends on the complexity of the game and of course how you write the server application.

You would basically use DBPro and DarkNet to make a server application that takes in data from every player, and sends it out to all the other players. It sounds simple, but when you think about it, that's a lot of data when you get more than just a few on.

To improve efficiency on the server you'll want to separate the game loop from the display loop. Only display the necessary text on the server display to let you know whats going on. This code snippet I wrote for Decoupling the Display Loop from the Game Loop is a great method for doing that. A display rate of 5 FPS for a server is plenty.

You'll want to install Windows XP or Windows 7 on the server computer. DBPro apps don't run on Windows Server. You can also install MySQL on the same machine.

In the server app using DarkNet, you would specify a port for the clients to connect to. When you're ready to have people on the internet connect to it, you'll want to forward that port on your router to the computer that's acting as your server.

Then write the client to connect to that port on your ip address.

I can't really go into to much more detail than that. If I need to then you may not have the skills necessary to pull it off at the moment. Which is ok, you'll just have to understand that there is a lot to learn to get where you want to be, and it's going to take time.

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 13th Nov 2010 17:02
Quote: "A display rate of 5 FPS for a server is plenty."


I would of thought only updating the screen once every 2 seconds would be enough, it's not data will be constantly looked at, is it? I have no experience, I'm just wondering.

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 13th Nov 2010 22:42
That would work too. I like to have it update a little faster just so I don't have to wait to long to see updates.

Login to post a reply

Server time is: 2026-07-21 18:58:10
Your offset time is: 2026-07-21 18:58:10