Thanks to all for your help. Going from 20 years of RPG to this is quite a shock. I found nothing in the FAQ so here goes:
I've 2 fields on my page:
<input type="text" name="name" value="<? echo $line2 [Name]; ?>" size="33" tabindex="2" ></td>
<input type="text" name="contact" value="<? echo $line2[Contact]; ?>" size="33" tabindex="3"></td>
I select the record from my database and populate the firlds. The user modifies the data then presses the Update button:
<input type=button value="Update Customer" onClick=updCust>
I have the updCust function defined as follows:
<?
function updCust()
{
$link = mysql_connect("localhost", "***", "*****"
mysql_select_db("******"
$query = "UPDATE tblCust SET Name='$name',Contact='$contact' where Cust ='$key'";
$result = mysql_query($query);
$line = mysql_fetch_array($result);
}
?>
I don't get any errors but the data does not get updated?!?
All help is greatly appreciated.
Scott
I've 2 fields on my page:
<input type="text" name="name" value="<? echo $line2 [Name]; ?>" size="33" tabindex="2" ></td>
<input type="text" name="contact" value="<? echo $line2[Contact]; ?>" size="33" tabindex="3"></td>
I select the record from my database and populate the firlds. The user modifies the data then presses the Update button:
<input type=button value="Update Customer" onClick=updCust>
I have the updCust function defined as follows:
<?
function updCust()
{
$link = mysql_connect("localhost", "***", "*****"
mysql_select_db("******"
$query = "UPDATE tblCust SET Name='$name',Contact='$contact' where Cust ='$key'";
$result = mysql_query($query);
$line = mysql_fetch_array($result);
}
?>
I don't get any errors but the data does not get updated?!?
All help is greatly appreciated.
Scott