Last active
December 15, 2015 15:09
-
-
Save imvkmark/5280120 to your computer and use it in GitHub Desktop.
mysql:creat insert sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createInsertSql(){ | |
$fields = array('tuanno','adddate','tuanname','tuanbianhao','buydate','dipeiname','guideno','guidemobile','contacttel','contactfax','tuantype','area','traffic','sleepis','sleephotel','tuannum','buynum','tickect','allnum'); | |
$sqlk = $sqlv = ''; | |
foreach($info as $k=>$v) { | |
if(in_array($k, $fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } | |
} | |
$sqlk = substr($sqlk, 1); | |
$sqlv = substr($sqlv, 1); | |
$db->query("INSERT INTO mg_form_team ($sqlk) VALUES ($sqlv)"); | |
if ($db->insert_id()) { | |
showmessage('申报完成,请等待审核!', WLSL_PATH.'member/'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment