Ebenze’s Weblog

Just another WordPress.com weblog

Archive for the ‘Uncategorized’ Category

SOLUTION! sendmail: unable to qualify my own domain name

Posted by ebenze on August 6, 2008

The solution is to add a line in your “/etc/hosts” file.

My computer is Nelly, and i’m doing localhosting sooo:

127.0.0.1 nelly.local. nelly

The format is:

[ipaddress] [longname] [shortname]

Obviously without the brackets.
Don’t know your name? Try pinging yourself or doing an:
>nslookup [shortname]

Posted in Uncategorized | Leave a Comment »

PHP Connect MsAccess 2000 – 2003

Posted by ebenze on August 6, 2008

 


ติดต่อ ฐานข้อมูล และ มีรหัสผ่าน

<?php
$db = “./access.mdb” ;  //ชื่อฐานข้อมูล MsAccess
$pass = “1234” ;  //รหัสผ่านคุณ

$conn = new COM(“ADODB.Connection”) ;
$sql = “DRIVER={Microsoft Access Driver (*.mdb)} ;
               DBQ=”. realpath($db) .” ;
               uid=admin ;
               pwd=$pass ;” ;
$conn->open($sql);
$rs = $conn->execute(“SELECT * FROM TableName”);
               while (!$rs->EOF) {
               echo $rs->Fields['FieldID']->Value ;
               echo $rs->Fields['FieldName']->Value ;
               $rs->MoveNext() ;
               }
$rs->Close() ;
$conn->Close() ;
?>


ติดต่อ ฐานข้อมูล ไม่มีรหัสผ่าน

<?php
$db = “./access.mdb” ;  //ชื่อฐานข้อมูล MsAccess

$conn = new COM(“ADODB.Connection”) ;
$sql = “DRIVER={Microsoft Access Driver (*.mdb)} ;
               DBQ=”. realpath($db) .” ;” ;
$conn->open($sql);
$rs = $conn->execute(“SELECT * FROM TableName”);
               while (!$rs->EOF) {
               echo $rs->Fields['FieldID']->Value ;
               echo $rs->Fields['FieldName']->Value ;
               $rs->MoveNext() ;
               }
$rs->Close() ;
$conn->Close() ;
?>

Posted in Uncategorized | Leave a Comment »