標籤:學習 while mysql 好的 項目 exp 資料 param price
最近比較浮躁不安,一直抗拒學習PHP,在身邊的朋友悉心引導下, 慢慢靜下心來。我好開心,能有這麼一個好的契機一邊上班 一邊學習。
<tr>
<td width="100">品牌</td>
<td>
<?php echo SqlSelect(‘goods where 1=1‘,‘brand‘,‘select‘,‘brand‘,‘-請選擇品牌-‘); ?>
</td>
</tr>
/**********資料庫篩選菜單********************************************************/
/**
* value 為ID時顯示函數
* @param string $SqlForm 表名+條件 admin where id = ‘$id‘
* @param string $SqlId 前端要顯示的value 一般為資料庫欄位
* @param string $SqlColumn 前端頁面顯示的title
* @param string $title 預設顯示,--請選擇--
* @param string $value 預設值的ID
*/
function SqlSelect($SqlForm,$SelectName,$class,$SqlColumn,$title){
$SearchSql = mysql_query("select * from {$SqlForm}");
while($Search = mysql_fetch_array($SearchSql)){
$key = $Search[$SqlColumn];
$option[$key] = $key;
}
return select($SelectName,$class,$title,$option);
}
/**********option列印函數********************************************************/
/**
* 列印函數
* @param string $title 預設第一個option
* @param array $option 選項集合 array(‘男‘,‘女‘)
* @param string $value 預設使用者選中
* @return 返回結果
*/
function option($title,$option,$value){}
<tr>
<td width="100">語種</td>
<td>
<select name="oLanguage" class="select textPrice">
<?php echo option(‘-請選擇語種-‘,explode(‘,‘,website(‘language‘)),$value);?>
</select>
</td>
</tr>
/**********輸出網站自訂文字********************************************************/
function website($id){
$website = query("website"," webid = ‘$id‘ ");
return $website[‘text‘];
}
/**********拆分字串為數值**************/
explode(‘邊界符‘,‘拆分的字串‘);
2017.08.18 筆記上
今天是專案經理指導學習PHP實戰項目的第二天