Document Conversion Online

Import/Export CSV, Excel, PDF, Database , Array, HTML, SQL, XML

Insert records to database


Student No
Title
First Name
Last Name
Gender
Male Female
Home No
Address
Mobile No
Email
Institute
Grade
Code For Database
<?php
/* include the ACS class page */
   require_once("../../classes/ACS.php");

/* Step 1: create object of the ACS class */
   $ACS=new ACS();
   
/* Step 2: set values of required parameters */   
//set tablename of the database
	$ACS->dbTableName="student";

//set 2 dimensional associative array
$data=array(array("studentNo"=>$_POST["studentNo"], "title"=>$_POST["title"], "firstName"=>$_POST["firstName"], "lastName"=>$_POST["lastName"], "gender"=>$_POST["gender"], "address"=>$_POST["address"], "mobileNumber"=>$_POST["mobileNo"], "homeNumber"=>$_POST["homeNo"], 
"email"=>$_POST["email"], "institute"=>$_POST["institute"], "grade"=>$_POST["grade"]));

$ACS->arrayToDB($data); //insert array to database

?>