最新回答 / Candy_cans
要把css引用的文件夾img放在和PC.php同級的目錄文件夾下面因為看似HTML文件的路徑在tpl文件夾下面,但是實際上是被include在PC.php里了。
2017-05-14
使用PHP調用Smarty顯示時 HTML模板當中的css沒有顯示布局改變 有方法解決么 直接打開HTML就能正常顯示
2017-05-14
// 記錄的刪除操作
function delete($table, $where = null) {
$where = ($where == null)? null : " where " . $where;
$sql = "delete from {$table} {$where}";
mysql_query($sql);
return mysql_affected_rows();
}
function delete($table, $where = null) {
$where = ($where == null)? null : " where " . $where;
$sql = "delete from {$table} {$where}";
mysql_query($sql);
return mysql_affected_rows();
}
2017-05-11
// 完成記錄的插入操作
function insert($table, $array) {
$keys = join(",", array_keys($array));
$vals = "'" . join("','", array_values($array)) . "'";
$sql = "insert {$table}($keys) values({$vals})";
mysql_query($sql);
return mysql_insert_id();
}
function insert($table, $array) {
$keys = join(",", array_keys($array));
$vals = "'" . join("','", array_values($array)) . "'";
$sql = "insert {$table}($keys) values({$vals})";
mysql_query($sql);
return mysql_insert_id();
}
2017-05-11
// 得到指定的一條記錄
function fetchOne($sql, $result_type = MYSQL_ASSOC) {
if (!($result = mysql_query($sql))) {
$this -> err($sql . "<br>" . mysql_errno() . ":" . mysql_error());
} else {
$row = mysql_fetch_array($result, $result_type);
return $row;
}
}
function fetchOne($sql, $result_type = MYSQL_ASSOC) {
if (!($result = mysql_query($sql))) {
$this -> err($sql . "<br>" . mysql_errno() . ":" . mysql_error());
} else {
$row = mysql_fetch_array($result, $result_type);
return $row;
}
}
2017-05-11