代碼第六行有一句多余的:C('test','show');估計是在沒寫后面的代碼時提前測試效果用的,視頻里也沒提,然后下一個視頻也沒說刪,但實際已經被刪了,導致運行的時候會顯示兩遍hello world。
2016-09-15
foreach ($data as $key => $value) {
array_push($sets, '`' . $key . '`' . '=' . '`' . $value . '`');
}
$sql = "UPDATE {$table} SET " . implode(',', $sets) . " WHERE {$where}";
array_push($sets, '`' . $key . '`' . '=' . '`' . $value . '`');
}
$sql = "UPDATE {$table} SET " . implode(',', $sets) . " WHERE {$where}";
2016-09-14
$keys = '`' . implode('`,`', array_keys($data)) . '`';
$values = '`' . implode('`,`', array_values($data)) . '`';
$sql = "INSERT INTO {$table}( {$keys} )VALUES( {$values} )";
$values = '`' . implode('`,`', array_values($data)) . '`';
$sql = "INSERT INTO {$table}( {$keys} )VALUES( {$values} )";
2016-09-14
$smarty->setLeftDelimiter('{');//左定界符
$smarty->setRightDelimiter('}');//右定界符
$smarty->setTemplateDir('temp/');//模板地址
$smarty->setCompileDir('comp/');//編譯文件
$smarty->setCacheDir('cache/');//緩存地址
$smarty->setRightDelimiter('}');//右定界符
$smarty->setTemplateDir('temp/');//模板地址
$smarty->setCompileDir('comp/');//編譯文件
$smarty->setCacheDir('cache/');//緩存地址
2016-09-14