$table_name = 'trn_pp_docscrutiny';
$fields_values = array( 'sbc_no' => "$sbcno",
'slno' => "$SlNo",
'dist_code' => "$DisttCode",
'site_blockno' => (empty($BlockNo))?0:"$BlockNo",
'doc_type' => (empty($DocType))?NULL:"$DocType",
'doc_no' => (empty($DocNo))?NULL:"$DocNo",
'doc_date' => (empty($DocDate))?NULL:"$DocDate",
'buyers_owners' => "$PresOwner",
'extent' => "$Extent",
'remarks' => (empty($Remarks))?NULL:"$Remarks"
);
$res = & $db->autoExecute($table_name, $fields_values, DB_AUTOQUERY_INSERT);
if (PEAR::isError($res)) { die($res->getDebugInfo()); }
* Here Empty check only performed for non mantatory Columns..
* update query also similar to insert query. only the last parameters only ll be changed like this
$res = $db->autoExecute($table_name, $fields_values,DB_AUTOQUERY_UPDATE, 'id = 1');
$fields_values = array( 'sbc_no' => "$sbcno",
'slno' => "$SlNo",
'dist_code' => "$DisttCode",
'site_blockno' => (empty($BlockNo))?0:"$BlockNo",
'doc_type' => (empty($DocType))?NULL:"$DocType",
'doc_no' => (empty($DocNo))?NULL:"$DocNo",
'doc_date' => (empty($DocDate))?NULL:"$DocDate",
'buyers_owners' => "$PresOwner",
'extent' => "$Extent",
'remarks' => (empty($Remarks))?NULL:"$Remarks"
);
$res = & $db->autoExecute($table_name, $fields_values, DB_AUTOQUERY_INSERT);
if (PEAR::isError($res)) { die($res->getDebugInfo()); }
* Here Empty check only performed for non mantatory Columns..
* update query also similar to insert query. only the last parameters only ll be changed like this
$res = $db->autoExecute($table_name, $fields_values,DB_AUTOQUERY_UPDATE, 'id = 1');
No comments:
Post a Comment