Monday, April 27, 2009

Free web template


Codingmind.com

is a free web templates site that you can use. Web templates also offer ready made , free to download Wordpress template, Joomla template and Flash template. Enjoy!

Thursday, February 19, 2009

my ever first Class that i understand and brought to me by :: jhoy

Class Database{

public $dbHost;
public $dbUser;
public $dbPass;
public $dbName;

public $db;
public $conn;

public $sql;
public $query;
public $result = NULL;

function __construct($host, $username, $password, $databaseName){
$this->dbHost = $host;
$this->dbUser = $username;
$this->dbPass = $password;
$this->dbName = $databaseName;
$this->connectDb();
$this->selectDb();
return $this;
}

function connectDb(){
$this->conn = mysql_connect($this->dbHost, $this->dbUser, $this->dbPass);
return $this;
}

function selectDb(){
$this->db = mysql_select_db($this->dbName);
return $this;
}

function setQuery($sql){
$this->sql = $sql;
return $this;
}

function runQuery(){
$this->query = mysql_query($this->sql, $this->conn) or print_r(mysql_error());

return $this;
}

function countResult(){ // SELECT
return mysql_num_rows($this->query);

}

function affectedRows(){ // INSERT INTO / UPDATE / DELETE FROM
return mysql_affected_rows($this->conn);
}

function getResult(){
if ($this->countResult() > 0){ // IF RESULT IS MORE THAN ZERO
$this->result = array();
while($row = mysql_fetch_assoc($this->query)){
$this->result[] = $row;
}
}

return $this->result; // THIS WILL RETURN NULL OR INTEGER VALUE
}
}

$dbObj = new Database("localhost", "root", "", "dbpeter");
/*
$getResult = $dbObj->setQuery("Select * from tbtemplate")->runQuery()->getResult(); // PHP 5 only continuous
$totalResult= $dbObj->countResult();
*/

$getResult = $dbObj->setQuery("INSERT INTO tbtemplate SET name='" . rand() . "'")->runQuery()->affectedRows(); // PHP 5 only continuous

$getResult = $dbObj->setQuery("Select id, name from tbtemplate")->runQuery()->getResult(); // PHP 5 only continuous
$totalResult= $dbObj->countResult();

if ($totalResult > 0 ){
foreach($getResult as $key=>$value){
echo $value['id'] . '
';
echo $value['name'] . '
';
echo $value['filetype'] . '
';
echo $value['upload_date'] . '
';
echo $value['filesize'] . '
';
}
}else{
//empty data
}



/*
mysql_escape_string
php magic_quote
*/

Monday, May 5, 2008

Great things about forums

A lot of people nowadays who are engaged in the Internet world have their own membered forums to share their ideas or ask questions.

But what exactly do we get in joining forums?
Does this help us in any way?
Do we benefit from it?
For me, these are definitely yes. Belonging to the right forum and of our choice is a win-win situation.

Here are some of my reasons why i love forums.


Primarily, forums can help you to solve your problems like in Programming, Designing, movies... Almost everything that we can think off. How? Forum members are from various fields, expertise, places, countries and groups that is why, we could share opinions about a certain subject from different points of views, logic and approach. Here, we could discover that there are numerous ways to solve a single problem.

Secondly, being an active forum member gives you the privilege to be known in the internet world and get a great job through this.

Thirdly, you can show your work to your fellow forum members and ask comments for any improvements and suggestions. This is very helpful since nobody is perfect, right?

Finally, choosing the right forum for your field of interest can absolutely help you improve your skills. Taking into a consideration my membered forums PHPUGPH who conducts seminars to us members to improve our skills on PHP and programming skills, and FlashVillage who gives free templates of flash designs to their members and teach them on how to use it.

These are few of the many reasons why being a member of quality forums is great.

Cheers to us forum members!

Tribute to my membered forums:

FlashVillage - http://www.flashvillage.com and PHPUGPH - http://www.phpugph.com
informatcasanova, Casanova, romeoinformatcasanova, Casanova, romeo

Monday, April 28, 2008

FLIXIN free video hosting


Flixin.com is a site where you can record your video and host it as well for free. You can download it through it's original format .flv a lot of other formats. You can also get it's source code to put it to your MYSPACE, BLOGGER, EBAY, LIVEJOURNAL, TYPEPAD or just get it's URL and other format. You can also download this for your Iphone/Ipod or windows mobile. You can also email this directly to your friends to share it. The things i love a bout this web site is that Primarily, they host your video for free and don't delete it for sometime. Secondly, You just open their site and record immediately, no need for 4 pages registration and a lot of staffs to enjoy their features. Finally, after recording your video do what ever you want about your video and they don't have any terms and agreement that all the recording you made is their copy right. The video is totally yours. For that i give them 4 stars. Cheers FLIXIN!