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 »