Export XLS file using Pear with PDO

We had published article about Pear library. Why we are using pear library because in export option they gave simple and flexible with ease of code implementation. In also their documentation clear to understand. Here we gave sample of how to use this and to export the users information as excel file with PDO OOPs .  Once you do with our sample code and if you are got idea you can customize code as your wish. 

 

export_excel_pdo

Read More

prevent sql injection in php

We had published after long time back article about SQL injection. First of all explain what is sql injection.To avoid the unwanted peoples are access your database without your knowledge i.e hacking.When the system (website) to ask the input from users in that time we won’t directly pass the input to the database we must validate the inputs.

Following things are to prevent the user input :

If you got the input from users, you have to validate using regular expressions for example.

Read More

Custom order by query by field name in mysql

In MySql select query we can customize the order of display the result as our wish. The following query I hope it will give some clear ideas do more thoughts in your future queries.

For example:

 

 

Select some data and insert into existing table in MYSQL query

Guys you are trying to insert data from one of your existing table to another existing table or same table in mysql you can use insert into select query. The following query will explain

You can add where clause too,