PHP Query Concatenation

Date: Posted by: Karthick In: MySQL, PHP

$sql = "INSERT INTO `application` (`id`,`app_id`,`course`,";
$sql .= "`app_name`,`father_name`,`dob`,`gender`,`occupation`,`address`,`email`,`mobile`,`nationality`,`religion`,";
$sql .= "`photo`, `created_date`, `updated_date`) ";
$sql .= "VALUES (NULL,1,'PHP','example_name','example_father_name','2000/1/1','m','business','exampleaddress','info@example.com',";
$sql .= "1231231234,'indian','religion',";
$sql .= "'app_photo.png','created_date','updated_date')";
echo $sql;
Output:
-------
INSERT INTO `application` (`id`,`application_id`,`course`,`applicant_name`,`father_or_guardian_name`,`dob`,`gender`,`occupation`,`address`,`email`,`mobile`,`nationality`,`religion`,`photo`, `created_date`, `updated_date`) VALUES (NULL,1,'PHP','example_name','example_father','2000/1/1','m','business','exampleaddress','info@example.com',1231231234,'indian','religion','photo','created_date','updated_date','app_photo.png','app_date_signature.png')

227 Views

Top