This Domain(Admin5.com) is for Sale:

My SQL数据库函数详解(3)

时间:2007-12-23  来源:不详  作者:迈克DB

",$meta->numeric);
printf("primary_key: %s
",$meta->primary_key);
printf("table: %s
",$meta->table);
printf("type: %s
",$meta->type);
printf("unique_key: %s
",$meta->unique_key);
printf("unsigned: %s
",$meta->unsigned);
printf("zerofill: %s
",$meta->zerofill);
print("</PRE>
");
}
?>

(12) array mysql_fetch_lengths(int result);
本函式将 mysql_fetch_row() 处理过的最后一列资料的各栏位资料最大长度放在阵列变数之中。若执行失败则传回 false 值。传回阵列的第一笔资料索引值是 0。

<?php
$link=mysql_pconnect("localhost","sunsoft","suixiang") or die("Could not connect");
mysql_select_db("stamp_db") or die("Could not select database");
$query="SELECT * FROM president" or die("Query failed");
$row_num=0;
while(mysql_fetch_row($result))
{
$row_num;
printf("Lengths of values in row %d:<BR>

本文来自织梦


",$row_num);
$len=mysql_fetch_lengths($result);
if(!$len)
{
print("No information available<BR>
");
break;
}
print("<PRE>
");
for($i=0;$i<mysql_num_fields($result);$i )
printf("Column %d: %s
",$i,$len[$i]);
print("</PRE>
");
}
?>

看完这篇,您有何感觉呢?

文章评论

共有位Admini5网友发表了评论 查看完整内容

24小时热门信息