PDA

View Full Version : Connecting To MYSQL Database~~~~~ Help For my RPG Gangster Game



iweb
19-12-2008, 02:43 PM
hey people,

i'am looking for someone to help me on my rpg php gangster game. I cannot set it up. I'am looking someone who can fix it if they fix it i will let them be co-owner of my website and i will give all rites throughout.


The problem is connecting to the mysql database.

Message Me If Intrested

Thanks

Joe (iWeb)

Jxhn
19-12-2008, 06:37 PM
Noone will help you if you spam.

Post what you're problem is.

Jackboy
19-12-2008, 06:48 PM
The problem is connecting to the mysql database.


No, the problem is: You don't know PHP.

Connecting to a database is the first thing i learnt, par echo etc

And why would anyone want co-owner when you would be doing nothing technical and claiming part ownership.

Besides theres are loads of RPGs around. Chav Wars is a good one haha.

illegal
20-12-2008, 11:52 AM
No, the problem is: You don't know PHP.

Connecting to a database is the first thing i learnt, par echo etc

And why would anyone want co-owner when you would be doing nothing technical and claiming part ownership.

Besides theres are loads of RPGs around. Chav Wars is a good one haha.
Exactly. Just learn some basic PHP online and you'll be able to do it yourself, there is no point trying to run a website if you cannot understand how to fix basic PHP errors.

Dentafrice
20-12-2008, 02:26 PM
No, the problem is: You don't know PHP.

Connecting to a database is the first thing i learnt, par echo etc

And why would anyone want co-owner when you would be doing nothing technical and claiming part ownership.

Besides theres are loads of RPGs around. Chav Wars is a good one haha.

It pisses me off when I see people who have no reputation, and nothing to back it up, flaming people.. like you.

You can't code PHP either.. you're not much higher then him on the ladder, so what gives you the right to start flaming him? With nothing to back it up.

He's just looking for some help fixing his problem, if you're not going to help him.. then why flame and post like that? He didn't ask for your opinion on it really.. he just asked for help.

--------------------

@op: Could you elaborate on your problem a little bit more? If you're using a "pre-made" RPG game.. could you tell us which one?

Surely it came with some instructions, it's most likely in a configuration file, be looking for that.. and make sure you've setup your database and user.

Jackboy
20-12-2008, 05:01 PM
It pisses me off when I see people who have no reputation, and nothing to back it up, flaming people.. like you.

You can't code PHP either.. you're not much higher then him on the ladder, so what gives you the right to start flaming him? With nothing to back it up.

He's just looking for some help fixing his problem, if you're not going to help him.. then why flame and post like that? He didn't ask for your opinion on it really.. he just asked for help.

LOL. Okay fair dos on the no opinion part of it. But how can you say I can't code PHP rofl. I don't have any trouble coding PHP and i do OOP tbh. I thought you were actually decent Caleb but you're a bit of a pfft :P

The only coding i actually struggle with is javascript. I am fine with PHP and I am at the level I hope to be.

And how the hell can you say I'm not much higher than him on the ladder? I can connect to a database. I will show you some of my code someone.

Calon
21-12-2008, 01:20 AM
Hey, I try to code in OOP and do things a little more complicated, here's the basic's of how to use mysql_connect() and mysql_select_db()



<?php
// Just remember, never use short tags. A lot of coders fall into this habbit
// And it is terribly evil. (Short tags being <? without the "php" after it.
mysql_connect( 'hostname', 'username', 'password' );
mysql_select_db( 'database_name' );
?>


mysql_connect()'s first parameter is the hostname, so that would be 'localhost' if you are running your database from the same server (Basically, if you use a control panel like cPanel and your database is in cPanel then you would add the hostname as 'localhost')

The second parameter is the username, on panels like cPanel they add your cPanel username and then the username you chose for your database, so for example you create a username for it of "cheese" and your cPanel username is "lolcats" then the username you would enter is "lolcats_cheese"

The third parameter for mysql_connect() is the password, there is no prefix for this, just add your password that you used to create the database.

Now for mysql_select_db()..

This function only has one parameter, again if you use a control panel like cPanel it's likely to add a prefix in front of your database name, example: cPanel username: "lolcats" and your database name: "coredb" then you would enter "lolcats_coredb"

Below is an example of the example's put into one..



<?php
mysql_connect( 'localhost', 'lolcats_cheese', 'somepassword' );
mysql_select_db( 'lolcats_coredb' );
?>


Just to let you know, when you're making your database you should give it full permissions, otherwise you will be unable to do things when you start creating your script.

This was probably way to complicated, but I hope it helps. :)

DeejayMachoo$
21-12-2008, 01:46 PM
ooo good mini tutorial calon :) that will be useful to new programmers :) +rep if i can

Calon
21-12-2008, 01:47 PM
ooo good mini tutorial calon :) that will be useful to new programmers :) +rep if i can
Lol, thank you.

Want to hide these adverts? Register an account for free!