Mass Militia

Posted in MassMilitia on June 22, 2009 by dragouth

I have a basic design for this game, but it was mostly done on impulse. I was playing Galatic Lords one day, and decided I wanted to make a military version of the game. It wouldn’t be set in the galaxy, and therefore not be grouped into the “space strategy” genre. It’s loosely based on that genre, but I have added and took away elements to make it it’s own.

Basic Design:

Users create accounts and build up their Nation by building buildings, training armies, and defeating other rival nations.

TO BE CONTINUED…..

Connect to a Mysql DB

Posted in PHP/MySql with tags , , , , , , , , on June 22, 2009 by dragouth

Ok, so in a way to help any new comers, I have decided to post up some helpful scripts. People can either learn from them, use them, claim them as their own, or bash on them. I don’t care, as long as someone gets some use our of them.
The first script I’ll be posting is the most basic one. It’s how to connect to a mysql database. This file will be called config.php, or connect.php whichever you prefer. But I use config, so that’s what I’ll call it.

config.php

<?
mysql_pconnect(“localhost”,”dbuser”,”dbpass”);
mysql_select_db(“dbname”);
?>

That’s the basic’s to the script. It can be altered, and you might see it a different way, such as,

<?
$dbname = dbname;
$dbuser = dbuser;
$dbpass = dbpass;
mysql_pconnect(“localhost”,”$dbuser”,”$dbpass”);
mysql_select_db(“$dbname”);
?>

But the concept is the same. Now all you would need to do is add,

<? include ‘config.php’; ?>

to the top of all your php pages.

Enjoy!

Follow

Get every new post delivered to your Inbox.