Sunday, 30 June 2013

Insert Coding using mysql

Insert Coding Using Mqsql :

This insert coding is used to  insert the values into the database using mysql.. This will be very usefull for the beginners who is learning PHP....

    $varname1=$_POST['fieldname1']; //field name in the form
    //insert coding
    $insert=mysql_query("insert into tablename(fieldname1 in database,fieldname2,fieldname3) values ('$varname1','$varname2','$varname3')") or mysql_error(); 
   //field name in the Database
        echo "Inserted";