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: