close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Difficulty loading existing data into an Edit Form.

Thread began 9/11/2014 8:05 am by Andrew | Last modified 4/02/2015 2:55 pm by Andrew | 1615 views | 14 replies

Andrew

Difficulty loading existing data into an Edit Form.

Hi Jason

Using the WebAssist Update Record feature, I'm having difficulty loading existing data into an Edit Form.

The link that should load the data is:
<a href="edit.php?itemID=<?php echo($rsItems->getColumnVal("itemID")); ?>">Edit this item</a>

and on the Edit Page, this appears in the browser address with the correct value for the item ID. However no data is loaded into the Edit Form.

The php code at the top of the Edit Page reads ....
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$UpdateQuery = new WA_MySQLi_Query($connsheffieldarchives);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "items";
$UpdateQuery->bindColumn("itemID", "s", "".($rsItems->getColumnVal("itemID")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("itemNo", "i", "".((isset($_POST["itemNo"]))?$_POST["itemNo"]:"") ."", "WA_DEFAULT");
.
.
.
$UpdateQuery->bindColumn("publicPrivate", "s", "".((isset($_POST["public"]))?$_POST["public"]:"") ."", "WA_DEFAULT");
$UpdateQuery->addFilter("itemID", "=", "i", "".($_GET['itemID']) ."");
$UpdateQuery->execute();
$UpdateGoTo = "admin_menu.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<?php
$rsItems = new WA_MySQLi_RS("rsItems",$connsheffieldarchives,1);
$rsItems->setQuery("SELECT * FROM items WHERE itemID = ?");
$rsItems->bindParam("i", "".(isset($_GET['itemID'])?$_GET['itemID']:"") ."", "-1"); //colname
$rsItems->execute();?>

Within the form, the data should appear in form fields that read (typically)
<input type="text" name="itemNo" id="itemNo" /> for text
and
<select name="decade" id="decade">
<?php
while(!$rsDecade->atEnd()) { //dyn select
?>
<option value="<?php echo($rsDecade->getColumnVal("decadeID")); ?>"<?php if (!(strcmp($rsDecade->getColumnVal("decadeID"), ($rsDecade->getColumnVal("decadeID"))))) {echo "selected=\"selected\"";} ?>><?php echo($rsDecade->getColumnVal("decadeName")); ?></option>
<?php
$rsDecade->moveNext();
} //dyn select
$rsDecade->moveFirst();
?>
</select> for tables

If it's any help, the relevant pages can be found at

http://archives.shearwaterwebdesign.co.uk/admin/edit_listing.php
with the link on the bottom of the following page.

Thanks in anticipation

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...