PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $vendorId = "b4ff9670-3481-4adc-9c4c-3c0b8f07d174"; $name = "Riverside"; $projectId = "827c879c-8dd6-4738-85f8-c14da2c743b8"; $exportId = "53067"; $total_freight = 465; $total_taxable = 17853; $total_nottaxable = 0; $total_credit_taxable = 0; $total_credit_nontaxable = 0; function clean($srt) { return $str; } $questions[] = "(?,?,?,?,?,?,?,?,?)"; $arguments[] = clean($vendorId); $arguments[] = clean($name); $arguments[] = clean($projectId); $arguments[] = clean($exportId); $arguments[] = filter_var(clean($total_freight), FILTER_VALIDATE_INT); $arguments[] = filter_var(clean($total_taxable), FILTER_VALIDATE_INT); $arguments[] = filter_var(clean($total_nontaxable), FILTER_VALIDATE_INT); $arguments[] = filter_var(clean($total_credit_taxable), FILTER_VALIDATE_INT); $arguments[] = filter_var(clean($total_credit_nontaxable), FILTER_VALIDATE_INT); $connection = &$pdo; if(!empty($questions) && !empty($arguments) && count($questions) == count($arguments) / 9){ $statement = $connection->prepare("INSERT INTO `aq_contract_estimate`(`vendorId`, `name`, `projectId`, `exportId`, `total_freight`, `total_taxable`, `total_nontaxable`, `total_credit_taxable`, `total_credit_nontaxable`) VALUES " . implode(", ", $questions)); $statement->execute($arguments); $statement->closeCursor(); }
Show:  
Copy Clear