What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » MySQL game

MySQL game
Author: Message:
Dox
Junior Member
**


Posts: 34
34 / Male / –
Joined: Oct 2005
O.P. MySQL game
I am making a game and it is supposed to send highscores from the game to a data-base but it can't connect, can somone help me?

I am using cPanel.
[Image: phpuser.jpg]

[Image: elixant%20user.gif]
Want 35% off all Elixant hosting packages? Drop me a PM
01-29-2006 04:00 PM
Profile E-Mail PM Find Quote Report
Jhrono
Veteran Member
*****


Posts: 1791
Reputation: 25
33 / Male / Flag
Joined: Jun 2004
RE: MySQL game
you've got to have the right database chosen, username password etc.. post the connection code you're using and someone will surely  help you
01-29-2006 04:05 PM
Profile E-Mail PM Find Quote Report
Dox
Junior Member
**


Posts: 34
34 / Male / –
Joined: Oct 2005
O.P. RE: MySQL game
what details do I need to post?
[Image: phpuser.jpg]

[Image: elixant%20user.gif]
Want 35% off all Elixant hosting packages? Drop me a PM
01-29-2006 04:13 PM
Profile E-Mail PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
21 / Other / Flag
Joined: Jul 2003
RE: MySQL game
code:
mysql_connect("localhost", "username", "password");
01-29-2006 04:16 PM
Profile PM Web Find Quote Report
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: MySQL game
quote:
Originally posted by Stigmata
code:
mysql_connect("localhost", "username", "password");


and also choose the right database:
code:
mysql_select_db('my_database') or die('Could not select database');

[Image: 1-0.png]
             
01-29-2006 05:21 PM
Profile PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: MySQL game
or even better mysqli :D

code:
$sql = new mysqli('localhost','username','password','dbname');


then just use $sql->query() to query your database :)

http://php.net/mysqli
[Image: dt2.0v2.png]      Happy Birthday, WDZ
01-30-2006 03:27 AM
Profile PM Web Find Quote Report
Dox
Junior Member
**


Posts: 34
34 / Male / –
Joined: Oct 2005
O.P. RE: MySQL game
ok, for me I can establish a connection from pages on my server but is there a way to make it so every PC (running my game) can connect to the database.
[Image: phpuser.jpg]

[Image: elixant%20user.gif]
Want 35% off all Elixant hosting packages? Drop me a PM
01-31-2006 01:24 AM
Profile E-Mail PM Find Quote Report
surfichris
Former Admin
*****

Avatar

Posts: 2365
Reputation: 81
Joined: Mar 2002
RE: MySQL game
Using something like a Winsock control or sockets, yes.

However most MySQL servers have them set up so they can only be accessed locally or from predefined addresses.

What you need to do is write a PHP script which your game submits the scores to, and then the PHP script stores the info in the DB.
01-31-2006 02:57 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On