Access 데이터베이스 및 데이터베이스에 데이터 삽입의 예제에 간단한 PHP 연결 중 하나
<? php
$connstr = "드라이버 microsoft Access 드라이버 (*.mdb); = D bq =". Realpath ("Db1.mdb");
$connid = odbc_connect ($connstr, "", "", SQL_CUR_USE_ODBC);
$ct 01 = $_post [ct01];
$ct 02 = $_post [ct02];
$ct 03 = $_post [ct03];
$ct 04 = $_post [ct04];
$ct 05 = $_post [ct05];
$ct 06 = $_post [ct06];
$name = $_post [이름];
$danwei = $_post [danwei];
$email = $_post [이메일];
$tele = $_post [텔 레];
$QQ = $_POST [QQ];
$yb = $_post [yb];
$content = $_post [내용];
$sql = "TB_TJ (ct01 ct02, ct03, ct04, ct05, ct06, 이름, danwei, 전자 우편, qq, yb, 콘텐츠)에 삽입
값 ('$ct', '$ct', '$ct', '$ct', '$ct', '$ct', '$name', '$danwei', '$email', '$qq', '$yb', '$content');
경우 (Odbc_do ($connid, $sql))
{
에코 "< 스크립트 > 경고" 축 하! 성공적으로 제출! '); 위치 = 'index.php'; < / 스크립트 > ';
}
다른
{
에코 "< 스크립트 > 경고" (' 죄송 합니다! 커밋 실패! '); 위치 = 'index.php'; < / 스크립트 > ';
}
? >