maxdb_field_count
maxdb::field_count
Returns the number of columns for the most recent query
&reftitle.description;
&style.procedural;
intmaxdb_field_count
resourcelink
&style.oop;
intmaxdb::field_count
Returns the number of columns for the most recent query on the connection
represented by the link parameter. This function
can be useful when using the maxdb_store_result
function to determine if the query should have produced a non-empty result
set or not without knowing the nature of the query.
&reftitle.returnvalues;
An integer representing the number of fields in a result set.
&reftitle.examples;
&style.oop;
query("DROP TABLE friends");
maxdb_report (MAXDB_REPORT_ERROR);
$maxdb->query( "CREATE TABLE friends (id int, name varchar(20))");
$maxdb->query( "INSERT INTO friends VALUES (1,'Hartmut')");
$maxdb->query( "INSERT INTO friends VALUES (2, 'Ulf')");
if ($maxdb->field_count()) {
/* this was a select/show or describe query */
$result = $maxdb->store_result();
/* process resultset */
$row = $result->fetch_row();
/* free resultset */
$result->close();
}
/* close connection */
$maxdb->close();
?>
]]>
&style.procedural;
]]>
The above example produces no output.