mmorpg , please dear god...

Member
Posts: 118
Joined: 2002.08
Post: #16
SubwayHeaven, here's what you need to do:
  1. Find some PHP-able hosting; hosting locally is fine. If you have a bit to spend, dreamhost.com packages can be had for almost nothing and will serve you fine for now.
  2. Do a couple basic PHP tutorials. Not the really exciting stuff quite yet, but even basic stuff is pretty exciting with PHP because you (if you get a host) can show off to your friends.
  3. Design and develop a smaller project on your own (without tutorials). This should be something simpler than an mmorpg. Maybe a simple blog-- that sort of thing.


At that point, you'll have enough of an understanding of web development that you'll be able to come up with the next step yourself. You're right, though; a basic web mmorpg is not out of your grasp.

If you need more help, send me a PM or email, and we can chat about it.
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #17
On Shivers' note, this is by far the best tutorial PHP I have found to date http://devzone.zend.com/node/view/id/627

Ohh and if you are 16 and have much better things to do besides check your post for basic spelling/grammar issues then perhaps you don't have the time to learn how to code. Try not to be rude to people who are giving you free advice you will get a lot further in life.
Quote this message in a reply
Member
Posts: 118
Joined: 2002.08
Post: #18
That Zend tutorial looks pretty swell. If it starts to get boring, take a break and use what you've already learned to create a little project of your own.

Don't stress out about the spelling stuff too much. I, like many people here, prefer nice grammar, &c, but realise that this preference is at odds with much of the internet. Consider it a "when in Rome" sort of thing.
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.05
Post: #19
Good good, point taken. Smile

EDIT: Yes...I found the "edit" button, anyway, Thanks a lot Shivers. I'll take your advice to heart and see what I can do.

Unfortunatly, my friends dont understand how big of a project this is going to be. I'm worried that they won't understand that it can't be something achieved overnight.

I have to admit though, they are focused on achieving something. One of the guys working with me (A guy named Calum) is devoting a huge amount of his time learning PHP and mySQL code.

And another guy named Harry (A good friend of mine) who pretty much motivates and guides us to this near impossible aim. He also funds the project (such as the server).

A proplem we are having now, is getting our server to connect to the mySQL database. Ive looked around for this infomation but I can't seem to find it anywhere...(Well...nowhere that seems to explain it well enough.)

If someone could give me a good link or maybe shead some light on this, I would be VERY gratefull.

Cheers.

Dave.

EDIT (Again): I looked at the link by the way. Very usefull. Nice theme aswell if you know what I mean. (Maybe it should be renamed to "Learning PHP with Neo").
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #20
Connecting to a database

// set path of database file
$db = $_SERVER['DOCUMENT_ROOT']."/../library.db";

// open database file
$handle = mysql_open($db) or die("Could not open database");
Quote this message in a reply
Moderator
Posts: 373
Joined: 2006.08
Post: #21
you may want to take a look at http://www.tizag.com as well, which is a pretty good PHP tutorial website in my experience Smile
-wyrmmage

Worlds at War (Current Project) - http://www.awkward-games.com/forum/
Quote this message in a reply
Member
Posts: 118
Joined: 2002.08
Post: #22
Is this a local mysql db that you're having trouble connecting to?
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.05
Post: #23
A local mysql db. Connecting to files hosted on a local apache server.

Any advice?

Grin
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #24
I provided the answer in my last post to you.
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.05
Post: #25
Can you maybe explain how that code works and what needs to be replaced?

Thanks again.
Quote this message in a reply
Member
Posts: 118
Joined: 2002.08
Post: #26
As far as I can tell, Kodex's code is for SQLite-- I connect to my local MySQL database like this:

Code:
$host = 'localhost';
$user = 'root';
$pass = '';

$conn = mysql_connect($host,
$user, $pass) or die ('I have made a giant tiny mistake.');

I don't have any experience with WAMP though, so I don't know if this'll do you any good.
Quote this message in a reply
⌘-R in Chief
Posts: 1,258
Joined: 2002.05
Post: #27
Shivers Wrote:As far as I can tell, Kodex's code is for SQLite

No, you don't use mysql_open to open an SQLite database. For that you use sqlite_open...


Quote:I connect to my local MySQL database like this:

There is more than one way to skin a cat. I'd rather do it by IP, like you, but there's nothing wrong with what Kodex posted.
Quote this message in a reply
Member
Posts: 118
Joined: 2002.08
Post: #28
Ahh, okay. I just wasn't familiar with Kodex's method. I suppose you learn something new every day, as the man says.
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.05
Post: #29
Okay, I'll look into it and get back to you.
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.05
Post: #30
Well first, sorry for taking so long, I have had a busy time.

I've tryed different forms of code, none of them work. I seriously don't understand why ether..

So far, I've chosen this as it seems the most simple and to the point.

<?php
$username = "your_name";
$password = "your_password";
$hostname = "localhost";

//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";
?>


I understand the code, but it simply doesn't work. The page loads empty. I load the .php file into my apache directory. Then open the file. But nothing happens. It has the HTML tags around it so no proplem there. The code *should* echo "Connected to MySQL" (Or the other bad quote) but doesn't say a thing. Just a blank page.

Odviosuly I edited it so it became this...

<?php
$username = "root";
$password = "";
$hostname = "localhost";

//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";
?>

I set no password. So I believe leaving it like that is defualt is "".

Any advice guys?

Cheers (Sorry for speling)
Quote this message in a reply
Post Reply