Generate Excel Report from MySQL Database using Codeigniter

Here we will see how to generate excel report from MySQL database using Codeigniter. Codeigniter is one of the popular PHP framework for web applications and it’s easy to work with Codeigniter for building web applications.

Why excel reporting?

Most people in your organization are likely to be familiar with excel, hence it ensures a short (or nonexistent) learning curve during implementation.

It allows you to use templates and formulas to aggregate data.

It has very easy-to-use charting functionality compared to other software, and several helpful built-in features.

It is also great because you have the ability to cut and paste into reports. Most people write reports in Word, so it’s easy to cut and paste data or charts from Excel into Word.

Here we will create a web application to generate excel report from MySQL database using Codeigniter.

We will create a table in MySQL database and retrieve the records from the table and display on a web page in table format. We will provide a hyper link to generate the excel file from the table data. You will be given a popup asking to save the generated excel file. Then you can choose your convenient location for saving the file.

Continue reading “Generate Excel Report from MySQL Database using Codeigniter”

Generate PDF Report from MySQL Database using Codeigniter

Here we will see how to generate pdf report from MySQL database using Codeigniter. Codeigniter is one of the popular PHP framework for web applications.

PDF format reports allows professionals to edit, share, collaborate and ensure the security of the content within digital documents.

Reports are mostly generated in PDF format because a PDF file is a “read only” document that cannot be altered without leaving an electronic footprint whereas other formats like image, word, excel etc. can easily be altered without leaving an electronic footprint.

PDF files are compatible across multiple platforms whereas a word document may not be viewable easily in Mac system.

Here we will create a web application to generate report from MySQL database using Codeigniter. We will create a table in MySQL database and retrieve the records from the table and display on a view in table format. We will provide a hyper link to generate the PDF from the table data. You will be given a popup asking to save the generated pdf file. Then you can choose your convenient location for saving the file.

Continue reading “Generate PDF Report from MySQL Database using Codeigniter”

Generate HTML Table from MySQL database using Codeigniter

Here is an example showing you how to generate HTML table from MySQL database using Codeigniter. We will write here an example to create a table from a multi-dimensional array. The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.

Here we will create a web application to generate HTML table from MySQL database using Codeigniter. We will create a table in MySQL database and retrieve the records from the table and display on a view in table format.

Continue reading “Generate HTML Table from MySQL database using Codeigniter”

Username availability check using Codeigniter, AJAX and MySQL

This tutorial will show you how you can check username availability using Codeigniter, AJAX and MySQL. Sometimes we need to check username availability instantly before a user presses the submit button after filling a long-sized signup form. In this case we can use AJAX technique with any server side technologies like PHP, Codeigniter, Servlet, Struts, JSF, Spring etc. for checking whether the input username is avaialable for creating new user account or it has already been taken by someone else. So if we give instant result to the user for username availability then sometimes it makes more sensible than while pressing the submit button and goes top of the signup form to rectify the username input field if input username is not available. So after finishing this example “username check availability using Codeigniter, AJAX and MySQL” you will be able to apply the same logic to any server side technologies.

Continue reading “Username availability check using Codeigniter, AJAX and MySQL”

Save Files to MySQL using PHP

We have seen file upload using PHP in previous tutorials PHP file upload but in this tutorial we will see how to save files to MySQL database using PHP.

You may be wonder why you would need to save file content into database rather than just into the file system. In situations where PHP application needs to put entire file then the preferred method would be to put the file into server’s file system and save the file path into the database.

However in situations, where an application needs to save the entire file content into database along with other data. In such cases you have to put the file content into MySQL’s BLOB data type field.

Continue reading “Save Files to MySQL using PHP”

Multi-step Registration form using Codeigniter, MySQL, jQuery

Sometimes we need to capture lots of user details during registration process and as a result we got long forms on web page. So the best solution is to break the form into smaller logical section and present it into a multi-step registration form. This type of mult-step registration form always improves usability on web page comparing to very long form.

I am going to explain how to convert very long form into multi-step registration form using Codeigniter, MySQL and jQuery.

Continue reading “Multi-step Registration form using Codeigniter, MySQL, jQuery”