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

rating

Update Working

Thread began 5/20/2016 8:44 am by stevenmcgough | Last modified 5/20/2016 1:23 pm by Ray Borduin | 170 views | 1 replies |

stevenmcgough

Update Working

Hi,
I have a very simple page as way of a test which is not working with an update. I followed the steps to create this and the resulting code is :


<?php require_once('Connections/PWS_Conn.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php require_once('webassist/mysqli/queryobj.php'); ?>
<?php
$RS_PWS = new WA_MySQLi_RS("RS_PWS",$PWS_Conn,1);
$RS_PWS->setQuery("SELECT * FROM pws_clients WHERE ID = ?");
$RS_PWS->bindParam("i", "".(isset($_GET['ID'])?$_GET['ID']:"") ."", "-1"); //colname
$RS_PWS->execute();
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$UpdateQuery = new WA_MySQLi_Query($PWS_Conn);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "pws_clients";
$UpdateQuery->bindColumn("Fname", "s", "".($RS_PWS->getColumnVal("Fname")) ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("Lname", "s", "".($RS_PWS->getColumnVal("Lname")) ."", "WA_DEFAULT");
$UpdateQuery->addFilter("ID", "=", "i", "".($_GET['ID']) ."");
$UpdateQuery->execute();
$UpdateGoTo = "updated.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="css/pws.css" rel="stylesheet" type="text/css">
</head>

<body>

<div class="form-style-8"><img src="assets/emails/pws_logo.png" width="126" height="127" alt=""/><br>
<br>
<strong>Welcome<br>
<?php echo($RS_PWS->getColumnVal("Fname")); ?></strong></div>

<div class="form-style-8">
<h2>Register for the VIP EVENT</h2>
<form action="" method="post" name="ClientsReg" id="ClientsReg">
<p>
<label for="Fname">First Name:</label>
<input name="Fname" type="text" id="Fname" value="<?php echo($RS_PWS->getColumnVal("Fname")); ?>">
</p>
<p>
<input type="submit" name="submit" id="submit" value="Submit">
</p>
</form>
</div>

</body>
</html>



BUT - it redirects to the updated page - but the record has not been updated...Any help would be appreciated

Sign in to reply to this post

Ray BorduinWebAssist

You have it set to update to the current recordset value, which isn't an update at all since it is setting it back to the original value.

Open the Update server behavior and bind the column values to the form fields not the recordset values.

Sign in to reply to this post

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...