PHP ADODB Generate HTML table function rs2html function "With Error handling function usage"

Source: Internet
Author: User
Tags add time
This article mainly introduces PHP ADODB generated HTML table function rs2html function, combined with instance form analysis PHP using ADODB class using function rs2html output result set HTML table related operation skills, and with error handling function errormsg usage, A friend you need can refer to the following

This article describes the PHP ADODB generated HTML table function rs2html function. Share to everyone for your reference, as follows:

One, the code

Adodb.inc.php can be downloaded from the official website http://adodb.sourceforge.net/.

conn.php:

<?php  include_once ('.. /adodb5/adodb.inc.php ');  $conn = adonewconnection (' mysql ');  $conn-pconnect (' localhost ', ' root ', ' root ', ' db_database14 ');  $conn, execute (' Set names gb2312 ');  $ADODB _fetch_mode = Adodb_fetch_both;? >

rs2html.php:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Ii. Results of operation

Attached: ADODB error handling function

<?php  include_once ' conn/conn.php ';  Load Database link file  $conn debug = true;  Open Debug  $sql = ' select * Form Tb_object ';  SQL query statement  $rst = $conn, execute ($sql) or Die ($conn-errormsg ());    Invoke Query Statement?>

Operation Result:

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.