Function

20 11 2007

When you have a set of variables or want to make your code simpler, you will use a function. Creating a function is really easy all you have to do is write something like:

function myFunctionName() {
//Function data
}

Read the rest of this entry »





Config File

19 11 2007

This is just an example of a config file which connects to a database for those who need it:

DEFINE (‘DB_USER’, ‘username’);
DEFINE (‘DB_PASSWORD’, ‘password’);
DEFINE (‘DB_HOST’, ‘localhost’);
DEFINE (‘DB_NAME’, ‘database name’);
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die (‘Could not connect to MySQL: ‘ . mysql_error());
@mysql_select_db (DB_NAME) OR die(‘Could not select the database: ‘ . mysql_error() );





Explode

19 11 2007

The explode function in php is very simple to use. The syntax is something like this:

explode( string seperator, string str );

And what the explode() function will do is get the string str as an array and then it will return each “word” separated by the first parameter as it’s own array element.
Read the rest of this entry »





Hello

14 11 2007

Just added my blog… I’ll start writing tutorials soon…