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”
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”
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”
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”
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”
This tutorial will show you how to call stored procedure using Codeigniter framework. Here we will use MySQL database for this example.
XAMPP in Windows
Continue reading “Call Stored Procedure using Codeigniter”
This tutorial will show how to find the number of employees under manager.
Continue reading “MySQL query to find number of employees under manager”
This tutorial will show how to find the managers who are having specified minimum number of employees working under them.
Continue reading “MySQL query to find managers who are having minimum number of employees under them”
Suppose, there is a table called sometbl and has the following data into it.
CREATE TABLE sometbl ( ID INT, NAME VARCHAR(50) );
INSERT INTO sometbl VALUES (1, 'Smith'), (2, 'Julio|Jones|Falcons'), (3, 'White|Snow'), (4, 'Paint|It|Red'), (5, 'Green|Lantern'), (6, 'Brown|bag');
Therefore for (2), example rows would look like >> “3, white”, “3, Snow” …
Continue reading “MySQL procedure to split a column into rows using a delimiter”