My code:
<BODY>
<h1>Adding table <?php echo "$table_name"; ?></h1>
<?php
$sql= "CREATE TABLE $table_name (";
for ( $i = 0; $i < count ($field_name); $i++) {
$sql .= "$field_name[$i] $field_type[$i]";
if ($field_length[$i] != " ") {
$sql .= " ($field_length[$i]),";
} else {
$sql .= ",";
}
}
$sql = substr($sql,0,-1);
$sql .= ")";
$connection = ifx_connect("informix", "lobdba","lobdba")
or die ("Could not connect to the database.");
$sql_result = ifx_query($sql,$connection) or die ("Could not execute query.");
if (!$sql_result) {
echo "<P>Couln't create table!";
} else {
echo "<P>$table_name has been created!";
}
//format result in HTML table, then free resources
ifx_htmltbl_result($sql_result,"border=1');
ifx_free_result($sql_result);
ifx_close($connection);
?>
When I execute the script above, I got a fatal msg:
Call to undefined function: ifx_connect().
Any help will be greatly appreciated.
Our Server: HP 9000 K200 workstation, runs HP-UX 10.10 and Informix Online Dynamic Server 7.2, Apache.
Thank you.