阿科
|
分享:
x0
|
[SQL][教学] 取出 enum 型态栏位的值
$mychat_conn = mysql_pconnect($mysqlhost,"ncc","passwd") or mysql_die(); @$mychat_link = mysql_select_db("ncc") or mysql_die(); $result=mysql_query("SHOW COLUMNS FROM app_order like 'PayMode'"); $row= mysql_fetch_array($result); echo "栏位名称:".$row["Field"]."<BR>"; echo "栏位资料型态]."<BR>"; echo "栏位是否 NULL:".$row["Null"]."<BR>"; echo "栏位是否 key]."<BR>"; echo "栏位的预设值:".$row["Default"]."<BR>"; echo "栏位额外选项]."<P>";
// enum('现金','线上刷卡','传真刷卡','来店刷卡','邮局划拨','银行汇款','ATM转帐','cccccccccc')
$a = $row["Type"]; $S1 = 'enum\(\'(.*)\'\)' if (ereg($S1,$a,$s1)) ;
$e = explode("','",$s1[1]); while (list($k,$v) = each($e)) {echo $v.'<br>'}
[ 此文章被andyz在2005-05-18 20:23重新编辑 ]
|