Web Prepration

Web Concept Tutorials

Others

CodeIgnitor, Others, PHP

In this post, we are going to explain “How to import Excel file into MySQL using CodeIgnitor”  using the PHPExcel library. For this things we will use third party PHPExcel library in Codeigniter for Import Excel sheet data into MySQL Database that means first we will read excel sheet data and then after we will store into PHP array and lastly we will perform a batch operation that means in a single query execution we will insert multiple data. In the Codeigniter framework, there is one insert_batch() query builder method by using this method we can insert multiple data in single query execution. This process will cover step by step in this post. How to Import Excel File into MySQL Using CodeIgnitor Step 1:-  First, we need to download the PHPExcel Library. Then extract PHPExcel Library inside “application/third_party” folder.   Step 2:- Create database and table or  copy below code

read more >>
CodeIgnitor, Laravel, Others, PHP

In this article, I am going to explain “How to export csv file in PHP”. The ability to export data in excel csv format is very useful feature for web applications. If you want to learn export data in excel then follow these easy steps. First create database and then create table in database. I have created organization table and table structure given below.

Now create export.php file and copy below code and paste it on created file.

In this file you can see, I have used array_walk function this a predefined php function. The array_walk() function runs each array element in a user-defined function. The array’s keys and values are parameters in the function. We hope that this article is helpful for creating export functionality in php. You may also want to read our other posts interesting and useful post then click  http://webprepration.com/  and also you can follow

read more >>
Others, Wordpress

In this post, I am going to explain how to create custom post type with category/taxonomy  in WordPress without any plugin. There are lots of plugin available for custom post type and taxonomy but if you want to create without any  plugin,then needs to follow given steps. You can create custom post in two ways first use  below code in your active theme functions.php file or create new own plugin and paste below code in your plugin file. Example:-

Now save file and check in admin new post type book is registered. you can create lots of custom post according to need using register_post_type(‘post_type_name’,$args); function. This function takes two parameters first post type name and second array type. Now for category/taxonomy WordPress provided predefined function register_taxonomy( ‘book-category’, array( ‘book’ ), $args );  This function adds or overwrites a taxonomy. It takes in a name, an object name that it affects, and

read more >>