|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
会MYSQL吗?会,我会把我的信息在数据库里插入删除啦笔记 ADODB使用:
<?php
$conn = new COM("ADODB.Connection");
$conn->Open("Provider = Microsoft.JET.OLEDB.4.0;Data source=D:\usr\www\html\data.mdb"); //ACCESS
//$conn->Open("Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=database;User ID=user;Password=password:)"; //SQL
$rs = $conn->Execute("select * from Spzs");
$num_columns = $rs->Fields->Count();
echo $num_columns . "\n笔记录<br>";
for ($i = 0;$i < $num_columns;$i++){
$fld[$i] = $rs->Fields($i);
}
$rowcount = 0;
while (!$rs->EOF){
for ($i=0;$i<$num_columns;$i++){
echo $fld[$i]->value . "\t"; //\t为TAB键
}
echo "<br><Br>";
$rowcount++; //rowcount递增
$rs->MoveNext();
}
$rs->Close();
$conn->Close();
$rs->Release();
$conn->Release();
$rs = null;
$conn = null;
?>
挪用WORD对象:
<?php
$word = new COM("word.application") or die ("Canot start Microsoft Word");
print "Loaded Word version ($word->Version)\n";
$word->visible = 1; //将其置前
$word->Documents->Add(); //翻开一个新文档
//随意做些工作
$word->Selection->Typetext("This is a test");
$word->Documents[1]->SaveAs("Useless test.doc");
$word->Quit(); //封闭WORD
//释放对象
$word->Release();
$word = null ;
?>
也或许是因为我还没有真正的学到深处吧,说实在的,PHP中的很多高级点的应用,如PHP类、PHP函数基本还是不懂吧! |
|