PHP database call class call instance database set php array insert database phpfirebird database ph

Source: Internet
Author: User
Database, php: PHP database call class call instance: config (dnsaaa; u); 3. select database $ dbname $ db-& gt; select
 Config ("dns = aaa; uid = sa; pwd = sa; dbname = test"); // 3. select database $ dbname = $ db-> select_db ("test"); // 4. set $ db-> debug = true; // 5. execute an SQL statement without returning results $ db-> execute ("insert into test01 (name) values ('this is a test! ') "); // $ Db-> exec (" "); // 6. execute an SQL statement $ rs = $ db-> query ("select * from test01"); // 7. display result echo in row MODE"
Display result sets in row mode
"; While ($ r = $ db-> fetch_row ($ rs) {echo $ r [0].": ". $ r [1]."
";}// 8. display the result in array format $ rs2 = $ db-> query (" select * from test01 "); echo"
Display result sets in array mode
"; While ($ r = $ db-> fetch_array ($ rs2) {echo $ r [" id "].": ". $ r [" name "]."
";}// X. release $ db-> db_close ();?>

The above introduces PHP database call class call instances, including the database and php content, and hopes to help friends who are interested in PHP tutorials.

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.