PHP Access data connection and read save edit Data _php Tutorial

Source: Internet
Author: User
PHP Tutorial Access data connection and read save data parsing

$conn = new COM ("ADODB. Connection ");
$connstr = "Driver={microsoft Access DRIVER (*.mdb)}; Dbq= ". Realpath ("Www.bkjia.com/db.mdb");
The COM interface is used to connect to the access.
$conn->open ($CONNSTR);
$rs = new COM ("ADODB. RecordSet ");
The data is queried and displayed.
$rs->open ("SELECT * from szd_t", $conn, 1, 1);
while (! $rs->eof) {
$f = $rs->fields (1);
Echo $f->value;
$rs->movenext ();
}

Let's take a look at the PHP Access database tutorial Save

$sql = "INSERT into szd_t (title) VALUES (' www.bkjia.com ')";

$rs->open ($sql);
Echo ' Save success ';

PHP Access database editing

$sql = "Update szd_t set title=" php100.com "where id=". $_get[' id '];

$rs->open ($sql);
Echo ' editing success ';

Delete data

$sql = "Delete from szd_t where id=". $_get[' id '];

This article is original in www.bkjia.com, reproduced annotated source


http://www.bkjia.com/PHPjc/444945.html www.bkjia.com true http://www.bkjia.com/PHPjc/444945.html techarticle PHP Tutorial Access data connection with read save data parsing $conn = new COM (ADODB. Connection); $connstr = Driver={microsoft Access DRIVER (*.mdb)}; Dbq=. Realpath (Www.bkjia.com/db.mdb ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.