Blogs

Using Zend Framework Zend_Form_Element_File for file uploading

As of Zend Framework 1.6 release. A new Zend_Form element has been interduced. The File element which can be used for uploading file

Here is how we can use Zend_Form_Element_File for uploading files
It is recommended that you take a look at Rob Allen tutorial (Here) on Zend Framework as this blog will depend heavily on it

First Create a new File on

/application/models/

and name it TestForm.php

Here is the content of the file

class TestForm extends Zend_Form
{

Using JDBC with MySQL

In this blog i will explain how to connect and retrieve data from MySQL database using MySQL JDBC Driver (Connector/J)

We will create a table to hold our contacts

DROP TABLE IF EXISTS `jdbc_test`.`contact`;
CREATE TABLE  `jdbc_test`.`contact` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(45) default NULL,
  `phone_number` varchar(45) default NULL,
  `email_address` varchar(45) default NULL,
  PRIMARY KEY  (`id`)
) ;

Then we will insert a couple of rows

INSERT INTO 
contact( name, phone_number, email_address) 

Getting Started with DB_DataObject

DB_DataObject is ORM package that enables you to perform CRUD operation very easily and smoothly
we will build a simple contact list
Run the following SQL statement

CREATE TABLE `Contacts` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) default NULL,
`email` varchar(255) default NULL,
`phone` varchar(15) default NULL,
`address` text,
PRIMARY KEY (`id`)
)

Code the generator
Notes:
1.You need to change the values to match your environment
2.You need to give DataObjects folder 777 permission

CreateDataObjects.php
<?php
require_once('PEAR.php');

Syndicate content