ifx_htmltbl_result

(PHP 3 >= 3.0.3, PHP 4, PHP 5)

ifx_htmltbl_result --  Formats all rows of a query into a HTML table

Description

int ifx_htmltbl_result ( int result_id [, string html_table_options] )

Returns the number of rows fetched or FALSE on error.

Formats all rows of the result_id query into a HTML table. The optional second argument is a string of <table> tag options

例子 1. Informix results as HTML table

<?php
$rid
= ifx_prepare ("select * from emp where name like " . $name,
                     
$connid, IFX_SCROLL);
if (!
$rid) {
    
/* ... error ... */
}
$rowcount = ifx_affected_rows ($rid);
if (
$rowcount > 1000) {
    
printf ("Too many rows in result set (%d)\n<br />", $rowcount);
    die (
"Please restrict your query<br />\n");
}
if (!
ifx_do($rid)) {
    
/* ... error ... */
}

ifx_htmltbl_result ($rid, "border=\"2\"");

ifx_free_result($rid);
?>


add a note add a note User Contributed Notes
konkukkim at kr dot qrio dot com
25-Oct-2001 07:49
Function ifx_htmltbl_result supports
blob data type, too. I hope this will help you.
alvarope at hotmail dot com
09-Aug-2001 09:50
This function is very useful even when you need to format the table (you can use style css) or you want to add links in a field, you can do like this:

$conn = ifx_connect ("dbpath@server","user","pass")OR die ("Could not Connect");
$query = "select fname as Name, '<a href=phppage.php?var='||appno||'>'||sname||'</a>' as Surname  from tab02 where sname like '$form_var%'";
/* You can select the name of the column with the 'as' and add the link */
$res = ifx_query($query, $conn);
ifx_htmltbl_result ($res, "border=\"2\"");
ifx_free_result($resultado);
ifx_close($conexion);