Wednesday, October 23, 2013

Simple, Easy and Flexible way of Writing Database insert Query

Hiiiiii, we know that when we write a insert query and we have to insert a new data and column in a Insert Query then it is very easy but what happen you have add new data  in new column name in somewhat big query, It will be very difficult to do so. For that purpose , in this post I'll be telling you how to write this much flexible query in which you can add new data and column name very easily. 
In the query writing method which I'll be showing here, it is very easy to add new column data and also this query looks good and is in easy readable form.
Database Insert Query

CODE BEGINS :

$insert_sql   ="  insert into tablename SET
                          username    = '".$username."',
                          comment     = '".$comment."',
                          star              = '".$star."',
                          date_from    = '".$date_from."',
                          date_to        = '".$date_to."',
                          added_on    = NOW(),
                          email           = '".$email."',
                          status           = 'unapproved'   ";



Hope you like this post……..Please Comment…………!!!!!!!!!


Tags:

0 Responses to “Simple, Easy and Flexible way of Writing Database insert Query”

Post a Comment

© 2013 MyCodeStock. All rights reserved.
Designed by SpicyTricks