I'm new to Joomla & chronoforms, and with a little help I've put together a form which writes to a database & another one which displays the data.
I've also created an edit page (again using chronoforms) which accepts the record's ID as a paramenter & populates the edit page text boxes with that record's values.
Now I'm stuck, as I can't get it to save the updated values to the database. I assume I need to enter some modified code in the 'autogenerated code' section for the edit page to function as an update statement, but I don't know how to proceed. I have a basic knowledge of SQL syntax, but the information I've found on PHP & SQL doesn't seem to match the syntax chronoforms uses.
Thanks for any help.
here's my 'edit page' form code which receives the recordID parameter:
Post edited by: aaron, at: 2008/02/01 23:10<br><br>Post edited by: aaron, at: 2008/02/01 23:28
I've also created an edit page (again using chronoforms) which accepts the record's ID as a paramenter & populates the edit page text boxes with that record's values.
Now I'm stuck, as I can't get it to save the updated values to the database. I assume I need to enter some modified code in the 'autogenerated code' section for the edit page to function as an update statement, but I don't know how to proceed. I have a basic knowledge of SQL syntax, but the information I've found on PHP & SQL doesn't seem to match the syntax chronoforms uses.
Thanks for any help.
here's my 'edit page' form code which receives the recordID parameter:
<?php
// initialise the database code
$recid = $_GET['recordID'];
global $database;
$sql = "SELECT cf_id, name, location, notes
FROM #__chronoforms_6
WHERE cf_id = $recid";
$database->setQuery($sql);
$rows = $database->loadObjectList();
foreach ( $rows as $record ) {
echo "
<p>
<label>Name</label>
<input type=\"text\" name=\"name\" value=\"".$record->name."\">
</p>
<p>
<label>Location</label>
<input type=\"text\" name=\"location\" value=\"".$record->location."\">
</p>
<p>
<label>Site Notes</label>
<textarea name=\"notes\" rows=\"5\" columns=\"20\">".$record->notes."</textarea>
</p>";
}
?>
<p>
<input type="submit" name="submit" value="Save Changes" />
</p>
Post edited by: aaron, at: 2008/02/01 23:10<br><br>Post edited by: aaron, at: 2008/02/01 23:28