Thursday, February 7, 2008

jhoy imperial and the web @ wordpress

yahoo! finally, i had the time to create my wordpress blog.
you can view it here : jhoy imperial and the web @ wordpress
after my hectic sched, at last, i managed to create one. =)

Wednesday, February 6, 2008

PHP Table Class

Here is the link to my new class : PHP Table Class

IE Sucks Part 2

Tried googling "IE Sucks" and i got this:
Results 1 - 10 of about 320,000 for IE Sucks. (0.22 seconds)

There are about 320, 000 articles and links that hates IE ,
then if you add mine that would be 320, 002, and i am not surprised. Here is a good link of explaining why you should dump IE.
I am using mozilla and i loved it, loving and will always ... I am not wondering why in stats IE is the most used browser, it's because of the fact that it is contained in the package of Windows Installer and the customer can't do anything about it.
The only way to wipe out/dump IE is to pass on these words to our fellow Internet savvy. Use mozilla or any other mozilla-based firefox and you'll soon see the difference of sucking IE and a beautiful mozilla.

IE Sucks



and it is draining blood out of my brain... buggy, non-compliant to web standards and css-fiend... grrr....



*walked out to the pantry for some coffee ...

Tuesday, February 5, 2008

Quotes

If you can't accept reality, you can't live a simple life. 02-05-2008

The only constant thing in the world is change.

Life is the most complicated subject in world. Problems can easily be translated into simple words and equations and yet the answers are still hard to apply. - jhoy imperial 01-08-2008

Monday, February 4, 2008

Simple PHP Database Connection Class

server  = $_DBINFO['server'];
$this->username = $_DBINFO['username'];
$this->password = $_DBINFO['password'];
$this->database = $_DBINFO['database'];
$this->connect();
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxx CREATES A SERVER CONNECTION xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
function connect(){
$this->conn = @mysql_connect($this->server, $this->username, $this->password);
if($this->conn == FALSE){
echo 'Cannot connect to server \''.$this->server.'\'.'; exit;
}
$dbconnect = @mysql_select_db($this->database, $this->conn);
if($dbconnect == FALSE){
echo 'Unable to connect to database \''.$this->database.'\''; exit;
}
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxx PROCESS SQL QUERY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
function query($sql){
$this->query = @mysql_query($sql, $this->conn) or print_r(mysql_error());
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxx QUERY RESULT IN ARRAY FORM xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
function getRecord(){
$resultCount = mysql_num_rows($this->query);

if ($resultCount==1){
$result = @mysql_fetch_assoc($this->query);
}
else if ($resultCount > 1){
while($row = @mysql_fetch_assoc($this->query)){
$result[]=$row;
}
}
else{
$result = NULL;
}
return $result;
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxx GET TOTAL RESULT COUNT xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
function query_count(){
return @mysql_num_rows($this->query);
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxx GET LAST INSERTED ID xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
function last_insert_id(){
return @mysql_insert_id($this->conn);
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxx RETURN ONLY ONE SPECIFIC FIELD xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
function getField($fieldname){
while($row = @mysql_fetch_assoc($this->query)){
$result[]=$row[$fieldname];
}
return $result;
}
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxx HOW-TO-USE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// A simple demo on how to use this module
// DIRECTION: download file and save then remove the ".txt" extension to be saved as a php file
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/*
// ASSIGN DATABASE SERVER INFO INTO ARRAY VALUES
$serverInfo['server'] = 'localhost';
$serverInfo['username'] = 'root';
$serverInfo['password'] = '';
$serverInfo['database'] = 'rednixchat';

// CREATE NEW Database OBJECT
$db = new Database($serverInfo)

// CREATE AN SQL STATEMENT
$sqlSelect = "SELECT * FROM user_info";

// PERFORM SQL STATEMENT ASSIGNED IN $sqlSelect
$db->query($sqlSelect);

// GET TOTAL RESULT FOR SQL QUERY
$totalResult = $db->query_count();

// GET QUERY RESULT IN ARRAY FORM
$queryResult = $db->getRecord();

// DISPLAY QUERY RESULT
print_r($queryResult);
*/
?>