The following code should work. Just remember to replace the mysql function with your ibase ones like replace mysql_query with ibase_query and also mysql_error with ibase_errmsg etc. Hope this works.
<?php
/*
CREATE Table TBL_RBSNEW(
RBS_ID INTEGER NOT NULL AUTO_INCREMENT,
RBS_RFPI VARCHAR(10),
RBS_IPADDRESS VARCHAR(30) ,
RBS_ENROLMENT INTEGER,
RBS_PAGINGTIMEOUT INTEGER,
RBS_CIPHERING INTEGER,
RBS_MACADDRESS VARCHAR(12) ,
RBS_SUBNETMASK VARCHAR(15),
RBS_ROUTERIP VARCHAR(30),
RBS_UPDATE INTEGER,
RBS_DELETE INTEGER ,
RBS_TFTPSERVERIPADDRESS VARCHAR(30),
RBS_TFTPFILENAME VARCHAR(255),
PRIMARY KEY (RBS_ID)
);
*/
$SESS_DBHOST = "localhost"; /* database server hostname */
$SESS_DBNAME = "temp"; /* database name */
$SESS_DBUSER = "root"; /* database user */
$SESS_DBPASS = ""; /* database password */
$SESS_DBH = "";
$SESS_DBH = mysql_connect($SESS_DBHOST, $SESS_DBUSER,$SESS_DBPASS);
mysql_select_db($SESS_DBNAME,$SESS_DBH);
// replace mysql_query with ibase_query and also mysql_error with ibase_errmsg
//Database connection details
if ($HTTP_POST_VARS){
/*-- the form was submitted, lets process it --*/
/*-- get a count of how many ids we have to process
--*/
$cnt = count($HTTP_POST_VARS['id']);
//$delete_sql = "DELETE from TBL_RBSNEW where id=$RBS_ID";
//$result = mysql_query($delete_sql);
/*-- cycle through the arrays and update the database
table --*/
for($cntr=0;$cntr<$cnt;$cntr++) {
if (!$HTTP_POST_VARS['enrolment'][$cntr])
$enrolment=0; else $enrolment=1;
if (!$HTTP_POST_VARS['ciphering'][$cntr])
$ciphering=0; else $ciphering=1;
if($HTTP_POST_VARS['ok'][$cntr])
{
$sql = "DELETE FROM TBL_RBSNEW ";
}
else
{
$sql = "update TBL_RBSNEW SET ".
"RBS_RFPI = '{$HTTP_POST_VARS['rfpi'][$cntr]}', ".
"RBS_IPADDRESS ='{$HTTP_POST_VARS['ip_address'][$cntr]}', ".
"RBS_ENROLMENT = $enrolment, ".
"RBS_CIPHERING = $ciphering, ".
"RBS_MACADDRESS ='{$HTTP_POST_VARS['mac_address'][$cntr]}', ".
"RBS_SUBNETMASK ='{$HTTP_POST_VARS['subnet_mask'][$cntr]}', ".
"RBS_ROUTERIP ='{$HTTP_POST_VARS['router_ip'][$cntr]}', ".
"RBS_TFTPSERVERIPADDRESS ='{$HTTP_POST_VARS['tftp_server'][$cntr]}', ".
"RBS_TFTPFILENAME = '{$HTTP_POST_VARS['tftp_file'][$cntr]}' ".
", RBS_DELETE = '{$HTTP_POST_VARS['delete'][$cntr]}' ";
}
$sql .= "where RBS_ID = {$HTTP_POST_VARS['id'][$cntr]}";
//$sql .= "where RBS_ID = {$HTTP_POST_VARS['id'][$cntr]}";
//"where RBS_ID = {$HTTP_POST_VARS['id'][$cntr]}";
$results = mysql_query($sql);
if (!$results) {
/* the query failed*/
echo "Error executing the update statement. <br
/>Interbase Reported:".mysql_error()." <br/>".
"SQL=$sql<br />\n";
}
}
}
/*-- this section is always shown --*/
/*-- get all records from the table --*/
//$select_sql = 'Select RBS_ID, RBS_TFTPSERVERIPADDRESS, RBS_TFTPFILENAME, RBS_ENROLMENT, RBS_CIPHERING, RBS_RFPI, RBS_IPADDRESS, RBS_MACADDRESS, RBS_SUBNETMASK, RBS_ROUTERIP from TBL_RBSNEW';
$select_sql = 'Select * from TBL_RBSNEW';
$result_id = mysql_query($select_sql) or die('Error
retrieving records from TBL_RBS.<br />Interbase
Reported: '.mysql_error());
?>
<b>Edit 'N' Delete RBS</b></p>
<form name="editRBS" action="<?=$HTTP_SERVER_VARS['PHP_SELF']?>" method="POST">
<table>
<?php
$counter=0;
$old_values=null;
while ($row = mysql_fetch_array($result_id)) {
$rfpi=$row[RBS_RFPI];
$ciphering=$row[RBS_CIPHERING];
$ipaddress=$row[RBS_IPADDRESS] ;
$macaddress=$row[RBS_MACADDRESS];
$subnetmask=$row[RBS_SUBNETMASK];
$routerip=$row[RBS_ROUTERIP];
$enrolment=$row[RBS_ENROLMENT];
$tftpserver=$row[RBS_TFTPSERVERIPADDRESS];
$tftpfile=$row[RBS_TFTPFILENAME];
/*-- output this row in the table --*/
?>
<tr style="margin:0; padding:0;" align="left" valign="top">
<td width="156" height="23">
<input type="text" name="rfpi[<?=$counter?>]" value="<?=$rfpi?>">
</td>
<td width="154" height="23">
<input type="text" name="ip_address[<?=$counter?>]" value="<?=$ipaddress?>">
</td>
<td width="69" height="23">
<input type="checkbox" name="enrolment[<?=$counter?>]" value="1"<? if ($enrolment==1)echo "checked";?>>
</td>
<td width="65" height="23">
<input type="checkbox" name="ciphering[<?=$counter?>]"
value="1" <? if ($ciphering==1)echo "checked";?>>
</td>
<td width="155" height="23">
<input type="text" name="mac_address[<?=$counter?>]"
value="<?=$macaddress?>">
</td>
<td width="156" height="23">
<input type="text" name="subnet_mask[<?=$counter?>]"
value="<?=$subnetmask?>">
</td>
<td width="156" height="23" align="left" valign="top">
<input type="text" name="router_ip[<?=$counter?>]"
value="<?=$routerip?>">
</td>
<td width="156" height="23" align="left" valign="top">
<input type="text" name="tftp_server[<?=$counter?>]"
value="<?=$tftpserver?>">
</td>
<td width="156" height="23" align="left" valign="top">
<input type="text" name="tftp_file[<?=$counter?>]"
value="<?=$tftpfile?>">
</td>
<td width="69" height="23">
<?
if ($row[RBS_DELETE]) {
echo"<input type=\"checkbox\" name=\"ok[$counter]\" value=\"1\">";
echo"<input type=\"checkbox\" name=\"cancel[$counter]\" value=\"1\">";
}
else
{echo"<input type=\"checkbox\" name=\"delete[$counter]\" value=\"1\">"; }
?>
</td>
</tr>
<?php
$old_values.=' <input type="hidden" name="id['.$counter.']" value="'.$row[RBS_ID].'">
';
$counter++;
}
?>
</table>
<?=$old_values?>
<input type="submit" name="submit" value="Update">
<input type="hidden" value="Reset">
</form>
</body>
</html>