Home >php教程 >php手册 >php 连接access的代码

php 连接access的代码

WBOY
WBOYOriginal
2016-05-26 08:20:59983browse

access数据库名为data.mdb,里面有一个数据表test,代码运行成功,希望对要使用PHP+Access做php程序的人有所帮助,实例代码如下:

<?php 
	$connstr="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("data.mdb");  
	$connid=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC); 
	$issuetime=date("Y-m-d H:i:s"); 
	$sql="insert into test values("","",...)"; 
	$result=odbc_exec($connid,$sql); 
	if($result) echo "successful"; 
	else echo "failed"; //phprm.com 
	

永久链接:

转载随意!带上文章地址吧。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn