Looking for Something?



Content:

Category:





PLEX: A Unique Puzzle MMO

Print All MySQL Database Tables & Fields Using PHP on 1.13.2009 - <?php //connection variables $database = "your_db_name"; $user = "your_username"; $pass = "your_pass"; //connection to the database mysql_connect($host, $user, $pass) or die ('cannot connect to the database: ' . mysql_error()); //select the database mysql_select_db($database) or die ('cannot select database: ' . mysql_error()); //loop to show all the tables and fields $loop = mysql_query("SHOW tables FROM $database") or die ('cannot select tables'); while($row = mysql_fe...

SQL Server 2005, Select All Tables & Fields on 1.13.2009 - SQL: select table_name, column_name, data_type, character_maximum_length, is_nullable from information_schema.columns where table_name in (select name from sysobjects where xtype='U') order by table_name...

Lesson 7: Pits of Doom -- Join, Login & Lost Password on 9.25.2008 - In the last lesson we created a database class to make doing queries quick and easy to handle. Then we converted over the current character file and map editor to use the database when storing/retrieving information. Finally, I added an additional file so you could import your map.txt files into your database from any you made in the previous lessons. Now it's time to make our game start to feel like a real game. In this lesson we'll create two new classes, a member's class and a character's ...

Lesson 6: Pits of Doom -- MySQL Database Class on 9.18.2008 - In the last lesson I introduced you to functions, reading & writing to a file, some simple javascript and adding features to the game so we could swap in/out maps and move up/down map levels. Now this is all fine and dandy, but we live in the age of databases so it's time to pull out your thinking caps. Let's get busy converting everything we've done so far to a database. Lesson Concepts MySQL Basics ...

Lesson 5: Pits of Doom -- Easy Map Editor on 9.18.2008 - In the last lesson we made some real progress. Now, instead of having a boring page with a click of one button before the game is over, we have a character that can move around a much larger area, be blocked by walls, fall into pits and die, and then win if they find the treasure. That's all fine and dandy but our game needs more substance. It's time to add more maps, map levels, and our very own easy map editor so we can quickly make maps, generate map files, and play our game with a whole n...

Lesson 2: Pits of Doom -- Breaking It Down on 7.14.2008 - One of the best things to do if you've never made a game before or you don't have much programming experience is to break things down into their most basic parts. We'll start off making this game by doing some really really simple programming and then adding functionality until the game is complete. It doesn't look like much now, but at the end of this tutorial you'll be able to download a fully working version with an installation file that you can use under the GNU public license to modify and...

Learning PHP (Part 3) on 5.3.2008 - In part 2 I covered else-if statements and more complicated if statements. One of the other concepts that's essential to learning any kind of programming is loops. There are three different types of loops (while loop, for loop, and do while loop), but I'm only going to cover two of them here. While Loops The concepts of loops is extremely simple. While some condition is true you're going to run the same bit of code again an...

Useful PHP Functions on 3.8.2008 - I ask myself why type the same thing over and over again when you can just use one function call? I've seen a lot of people do that, so stop it! Save yourself the trouble. Here are some things I use a lot: <?php /**** * Purpose: return a formatted error message * Precondition: the message to display * Postcondition: formatted message echoed to the screen ****/ function errorMsg($message) { return "<span class=\"errorMsg\"><center>Error: " . $message . "</cente...

Learning PHP (Part 2) on 2.23.2008 - In part 1, I talked about requirements for php, creating a file, variables, and if-else statements. Now on to harder concepts. Else-If Statements Before we covered the if-else statement. In an if-else statement if something is true take some action, otherwise do something else. The else-if statement builds on the power of an if-else. Look at this example: <?php $money = 20; $bread = 5; $candy = 5; $cake = ...

9 results found