jigniter™

jQuery & CodeIgniter – Perfect combination for web application

Archive for the ‘libraries’ tag

Import CSV file into database using CodeIgniter

without comments

CSVReader is a library for CodeIgniter that can help you importing CSV files into database using CodeIgniter framework. The library uses fgetcsv function from PHP to get the content from CSV file and then iterates over the records returning an array as result.

Then, you can iterate the parsed results from the CSV file to insert them into the database easily using a foreach statement. For example, you can refer to Clooner’s proposal here.

This CSVReader library can be really helpful in case you need to import large CSV files into the database using a CodeIgniter application, but also can be useful to import Excel files into the database or any other database file that can be exported to CSV. For Excel, you can export the results using comma separated values and then use this approach.

Written byadmin

July 14th, 2010 at 8:15 am

Posted inSnippets Ideas

Tagged with , ,

Simple Form Generation in CodeIgniter

with 7 comments

If you are using CodeIgniter, as well as any other PHP framework, you may notice that building CRUD forms is one of the most bother and routine tasks. Probably 80% of general web applications uses CRUD (create/read/update/delete).

In CodeIgniter, you can use any of the form generation libraries.

One of my preferred libraries is Form Generation Library by Frank Michel (see @macigniter’s thread here). It allows you to create clean XHTML forms with CodeIgniter. See demo here.

Using Form Generation Library

So, in order to use this library, you need to download it from here (library files only is enough if you don’t want the entire site structure).

Read the rest of this entry »

Written byadmin

August 2nd, 2009 at 6:30 pm

Posted inTutorials

Tagged with , ,