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

php 连接access的代码

WBOY
Release: 2016-05-26 08:20:59
Original
988 people have browsed it

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 
	
Copy after login

永久链接:

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template