Similar Threads
1. Problem with update record server behaviour - Adobe Dreamweaver
2. Problem with update record, then link to file
Environment:
Dreamweaver 8, MySQL, PHP.
I have a repeating record from my database. I added an Update Record server
behavior for each search result for the result table. I added a button to the
form and changed "submit" to "view". Pressing "view" is supposed to allow the
user to view the detailed record information.
The Update Record server behavior is supposed to do two things:
1) add 1 to the 'numViews' filed of the record's database entry when the
"view" button is pressed
2) After updating the numViews field, the form is supposed to redirect the
user to the detailed record
I found that depending on how I create the record, I an do one of the above 2
behaviors, but not both. HELP!
To add 1 to the numViews field, I created a form variable called incNumViews,
which does the following:
<?php echo $row_rsSearchResults['recipeNumViews']+1; ?>
Very simple.
The Update Record ends up changing the form action to the following:
<?php echo $editFormAction; ?>
Looking at the code for this, I ee the following:
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
But when the "view" (ie: submit" button for the form is pressed, I get
redirected back to the same repeating record search result page, not to the
record detail page.
However, the numViews field in the record is getting properly incremented.
I tried to get around this by changing the Update Record behavior "After
updating, go to:" field to point to the record detail page, and tried passing a
parameter tot he recordID I want to see details of, as a URL parameter, but
that does not work.
If I change the Update Record form action from
<?php echo $editFormAction; ?>
to
record_detail.php?recordID=<?php echo $row_rsSearchResults['recordID']; ?>
Then I am able to link to the detail page, but NOT update the numViews field.
HOW can I fix this to both update the record, then jump to the detail page
with a URL parameter being passed, when I click the "view" (submit) button o
the form??
Thanks in advance.
3. Problems when updating record - Dreamweaver
4. Problem with update record (PHP/My SQL)
Perfect thanks
I went for the back ticks option as the column names are engrained too deeply
in the rest if the site for me to change them now. But the back ticks did the
trick first time.
Cheers
Dave
5. security problem with update-record wizard? - Dreamweaver
6. Bizarre error causes update of one record to update ALL records
I came across something rather odd when updating a value in a database
table. Instead of updating the record with the new value, it updates
ALL the records in the table.
Make a database table with fields ID (int, PK) and DATE1
(smalldatetime). Add three records 1, 2, and 3 with null DATE1. Then
execute the following ASP page:
<!-- METADATA TYPE="typelib" FILE="C:\Program Files\Common
Files\System\ado\msado15.dll" -->
<%
const DBServer = "localhost"
const DBName = "DEVL"
const DBOwner = "dbo"
const DBPrefix = "DEVL.dbo."
const DBPassword = "password"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open "DRIVER={SQL Server};UID=" & DBOwner & ";PWD=" &
DBPassword & ";SERVER=" & DBServer & ";DATABASE=" & DBName
Set rsRec = Server.CreateObject("ADODB.Recordset")
strSql = "select DATE1 from TEST where ID=1"
rsRec.Open strSql, objConn, adOpenForwardOnly, adLockOptimistic
rsRec("DATE1") = "10/10/2005"
rsRec.Update
rsRec.Close
objConn.Close
%>
The DATE1 field for ALL THREE records is set to 10/10/2005, even though
only ID=1 was specified in the SQL where clause.
Some things to note:
1) It does not happen if the connection is adOpenStatic.
2) It does not happen if you do "select *" or include the ID (primary
key) field in the select statement.
I'm sure this has to do with using adOpenForwardOnly (which I have
stopped doing) but I would just like some sort of reason why it
happened in the first place.
7. Update multiple records and fields problem - Database Tutorial in ASP
8. Delete records or update records
I created a form that will update or delete a record using ASP and FrontPage 2002. This worked fine until I loaded the .Net framework 1.1 on my Win 2K server. Now when a user tries to delete a record or perform an update of a record the following error is given.
Your page contains a query with user input parameters that could not be resolved.
This could happen if your DatabaseRegionStart webbot has an empty or missing s-columnnames or s-columntypes attributes.
You may need to read Microsoft Knowledge Base Article 817029.
This article only refers to how to fix the problem in FrontPage 2003. What do we do to fix the error for those of us who have not updated to FP 2003?