UPDATE Mysql Record From Within <A HREF...>

I have a .asp page that displays an HTML page: view_msg.asp

There is a link (anchor tag) on that page that when clicked, sends the user to another page. I would like to also execute a MySQL query when that link is clicked. The DB is already open and connected to the page. The current current tag looks like this:

<a href="view_messages.asp"><IMG SRC="example.gif"></a>

and the MySql command I want to send is:
UPDATE Messages SET `fromDisplay`="N" WHERE idMessage=" & idMsg "

In english: When someone clicks on the link I want to execute a MySQL command to set the field value to N... how do I do that?

I know this is a very rookie question - but I don't know enough about asp to know how to execute the command here the way I want. Do I have to turn the image/button into a <FORM> 'submit' button</FORM> and use a redirect? Or, would I use an ONLCKICK. What would the correct syntax be?

View Replies


ADVERTISEMENT

Update Record In MYSQL

ASP VB. I have 1 recordset where I pull the order in.
I have another that I pull in the on-hand qty.
I used a repeat region and now I have it working to display the new on-hand qty. Now I just need to update the recordset with the qty on hand.

View Replies View Related

MySql Field Update

Why is it that this does not work in MySql?

RS.Fields("Fullname").value = "Bob"

Is it because MySql does not support this?

The code below is a bit more representative of what I'm doing:

<!--#INCLUDE FILE="Database_Open.asp"-->
<%
sql ="SELECT * FROM CustomerBase WHERE " & _
"UserName='" & username & "' AND " & _
"SECRETWORD='" & password & "' "

RS.Open Sql, Connection, 3

IF RS.EOF THEN
'redirect code here
ELSE
RS.Fields("Fullname").value = "Bob"
RS.Update
%><!--#INCLUDE FILE="Database_Close.asp"--><%
Response.Redirect ("Menu_Account.asp")
END IF
%>

View Replies View Related

Update MySQL Problem

I've always sticked to MS SQL Server because it doesnt give me troubles that I have with MySQL. But decided to give it another shot.

I use "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=myserver; DATABASE=mybase; UID=myid;PASSWORD=mypwd; OPTION=3" connstring to connect to my database online.

I can read and get records off the database easily, but everytime I try to update records using recordset

rs. open "SELECT * FROM MyTable", Conn, 3, 3
rs("Content")="Hello" 'text datatypers.update

It always generates error. Can some1 help me with this?

View Replies View Related

Retrieve A Record Identity From A Mysql

is there any way I retrieve record identity from data that i just insert in...

View Replies View Related

ASP - Date Formating MySql Insert/update

I am storing dates in a mySql database in the format yyyy-mm-dd. Now, I have set up so that this field is insert by a form.

It isn't very user friendly to have to type yyyy-mm-dd, how can I set up so that the user can enter format dd/mm/yyyy and it will automatically insert into the database as yyyy-mm-dd? I am using Dreamweaver MX 2004 and ASP.

View Replies View Related

Update Certain Record

i just wanna know how to be able to update certain fields without touching the others

for example if the form has 3 fields
description, name and age....

if i wanted to update the database from these fields, but only update the description while leaving the ohters as they are, which means blank fields in form...

now if i do that on my form, it will clear other 2 fields in the database and only update the description... how can i fix that so that when there's blank fields in form in won't clear the data in database ?

View Replies View Related

Update Record

This is probably a easy answer for you guys. Just trying to find the easiest way to do this. I want to click on a link and update a field in a recordset, but don't want
to leave the current page.

HrngID is the link. I want to change the Canceled field from a 1 to 0 when clicking on the link . I know I can use a onclick event, but not sure if these is an easier way. Can I do like a onclick and run a SQL statement on one line?

View Replies View Related

Cannot Update Or Add New Record

I am using Windows XP profesional and Access 2000 but are experiencing
problems updating or adding new records to my database with asp.
I have installed IIS 5.1 on my computer but also on my internet site I am
having problems to add a new rec. or update one.

The error message is something like:

< Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable
query. >

I get this message on my web site as well as when I try some new tests, with
other databases, on my local PC's IIS. Does anybody know what is wrong? It
used to work okay earlier on my web site?

View Replies View Related

Add/update A Record In First Table And 2nd

i can add the record in first table but cant get it to do with the second one one of the field in the first table the "mktid" which is the primary and is a forgeiner key in the second table how can i have it insert or update in the second one Code:

View Replies View Related

Add/update A Record In First Table And 2nd

add/update a record in first table and 2nd i can add the record in first table but cant get it to do with the second one

one of the field in the first table the "mktid" which is the primary and is a forgeiner key in the second table how can i have it insert or update in the second one

addnew.html

Code:

View Replies View Related

Multi Record Update

I have a table in the db and one field in the db is an email field various records can have the same email address in. When an email address changes from x to y I want to be able to change an email address x in every record in the table to y, how would I do this?

View Replies View Related

Update Record Problem

ok im trying to update a record.. i have my edit form working (i think) and now im just making the code to update that record..

im gettin this error tho

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. Code:

View Replies View Related

Insert/update Record

I have to compare 2 tables: orderA and orderB, if the record exists in both table orderB and orderA, just do a update to the quantity field in orderB (add orderA.quantity to orderB.quantity). Otherwise a new record has to be insert into orderB.

Do I have to loop through the recordset of orderB, then use select statement to see whether the record exists in orderA or not, and determine whether to update/insert record? I am using Access database. I just afraid that looping through each record in recordset (maybe >=30 record each time) would make the transaction getting slow (or even hang??). Can I do this in one SQL statement?

View Replies View Related

Can Not Update A Record If There Is A ' In The Text Field

i'm trying to figure out why i can not update a record if in the text box there is a ' anywhere in the field..

View Replies View Related

Update Record Without A Form In Dreamweaver MX

I'm new to ASP so I'm using DWMX as a crutch. It created the db connection and recordset code for me and all I want to do is have the page update the db with the result of a variable.

In plain English, I'm trying to update a field called Score in the table quizOne with the results of the variable score where the username field matches the session variable MM_Username. The recordset is called update_score.

Based on other tutorials and forums, I tried this: ....

View Replies View Related

Update Record On Page Load

how to Update Record On Page Load. I have one feild in my database that I want to subtract 1 from each time the page is loaded.

View Replies View Related

Mail And Update MS Access Record At Same Time

I have a form on a website for logged-in customers to update their contact details, when the customer update their contact details it should update the record in the database and at the same time the updated contact details should be sent to me by email.

I'm not an expert in ASP 3.0 and therefor I'm using dreamweaver 8 to create asp pages(ASP 3.0 VB), but dreamweaver does not have such kind of fuction(server behavior) to do this and so I have to create this by hand.

Now I already have page with the form that updates the record in the database, and I also have another page that does the mailing(CDONTS), first it updates the record in the database and in dreamweaver I have set "after insert the record go to mail_processing.asp" , but this does not work.

I can only get one to work, either only update the record or only mail the form data.

How can I make it to update and mail at the same time?

View Replies View Related

.update Creates New Record But All Fields Null

I have made several Access-based CMSs but now I am using SQL Server. I can read the records but my first attempts at writing are resulting in new records (with new ID) but all the fields are null.

I am posting the data from a form to the same page and an if /then statement catches the flag in the URL and runs the update script below. All the field names are correct. Code:

View Replies View Related

Need To Modify A Dreamweaver Update Record Script

I need to alter a dremweaver Update Record function but am a bit lost with it. I basically need to take the values from 3 drop downs that let you selct the date (day, month year). I've written a variavble that adds these together to make a date:

JJ_theDate = Request.Form(selectDay) & "-" & Request.Form(selectMonth) & "-" & Request.Form(selectYear)

but have no idea how/where to slot this in with Dreamwevers code (below) that does the SQL update.. Code:

View Replies View Related

Update Record In A Popup And Then Refresh Main Window

I have a main window which shows all records from a table. When a user clicks on "Edit" for a record, a popup showing information of the selected record is displayed.

The user then changes the information on the popup and clicks "OK" button which calls an ASP page to update that record in the table. Everything works with no problem up to this stage.

My problem start after the update process. I need to know how to close the popup and then refresh the main window showing the updated information....

View Replies View Related

Href In Asp

Have you ever been on ebay-You know when you are checking a persons feedback history, you see a href link to go and see that particular item.

I would like to do the same. If i have a table which i populate with information, if the user clicks on view, i would like to go and show that particular item on another page. Ebay has one unique key (item number), unfortunatley i have a composite key.

How can i do this by adding a href in an asp table and also by having the ability to go directly to the full information about that specific item?

I have done something similar in vb but i used a mshflexgrid but i don't think thats a possibility in asp.

View Replies View Related

If Then With HREF?

I have a master table of records from a recordset on which thereis a link to a detail page as follows: Code:

<td width="10%" align="left" class="langdetail"><a href="Advanced_Search_detail_template1.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "TeacherID=" & rsViewMusic.Fields.Item("TeacherID").Value %>"><%=(rsViewMusic.Fields.Item("LastName").Value)%></a> </td>

Is it possible to have to include an if then statement to have 2 different detail pages according to an access level (a field in the recordset)?

View Replies View Related

HREF

I saw an url like this

<a
href="{nocache:426d6de96f848e23f89ef8d2a557145f#0}&p=http://www.isbuluyorum.
com>CLICK</a>

What is the purpose of using href="{nocache:1321sdsa . Does anyone have idea about it ?

View Replies View Related

A Href

Can anyone tell me the proper syntax for this statement:

Response.Write "<a href=""Showevent.asp?eventid=<%= objrs.Fields("eventdate").Value %>""">(objRS("eventcaption"))</a>

View Replies View Related

Href (link)

I would like to have a link that when clicked, sends info to an ASP page to process, but does not submit the entire page. This way, the user will
click on a link and will not be taken to another page, but precessing will occur.
This is mainly for a 'Rating' Application.
Amazon.com does this and I want to know how they do it. Here is the link to the amazon page (you may need to be logged in)
http://www.amazon.com/exec/obidos/t...5480771-6490552.

View Replies View Related

Base Href

I'm using W2k Pro, ASP 3, IIS 5 & DWMX 6.1 and code in VBSCRIPT
I currently use the <BASE href=XXXX> in all my pages and just read
that this tag is no longer supported so will soon vanish
I have a couple of sites that I'm working on and to make all my links
work right etc I need to use the base href tag

http://localhost/site1/
http://localhost/site2/
http://localhost/site3/

where online the base href would be

http://www.site1.com/
http://www.site2.com/
http://www.site3.com/

all my links are like <img src=images/mylogo.gif> or <a
src=info/info.asp>Info</a>

Now my problem is how else would I design my sites if I cant use the
Base href tag so the site would work both on LOCAL & REMOTE servers as
needed in the above paths?I'm sure other people develop on a WIN 2k PRO system where you canonly have ONE site (c:inetputwwwrooot) Which was fine when I only
had one site... but when I needed a second I had to change my first to
use the Base href so I could check the sites out locally (offline)
before uploading them to a live server.

View Replies View Related

Href Problem

when i click the a link i want to see a thing which is like save as target
...

it can be a word doc or xls or whatever. i want to make it dowloadable when
a user click a link.. Code:

View Replies View Related

Putting A # In A Href With The ?

If you have a href such as this,

href="somepage.asp?home=alpha&street=beta, how would you include a reference to a bookmark on that page, such as <li id="bookmark">Some List Item</li>

View Replies View Related

Using If Then Statements In Href Tag

Is it possible to use If Then statements in an a href tag? What I am trying to do is I am using a server side include page of navigation inside of a content management system. I have limitations on what I can manipulate and change. So just using style sheets won't do me the trick. I want to have a navigation link change a different color when you are on that section. I have the menu expanding also using if then statements. When a variable is passed somewhere else on the page as true, the menu expands. I figured I could use this in the same way to make the link change colors. I want to do something like:

<A href="#" <% If Variable_name then%> id="link <% end if %>>Link Here </a>

Is that possible? I know that i can do an If then statement and have 2 different links, one with the id and one without, but I wanted to see if I could simplify it at all. I'm not the best with ASP so there might even be better ways then that...I was just using from the little that I knew.

View Replies View Related

Using Variable Name In Href

How can i use the variable name instead of a hardcoded value when writing a hyperlink.

strBody = strBody & "<a href="default.htnk">Login</a>"

I would like to use a variable name instead of directly writing default.html like below

strPageName = "default.html"

strBody = strBody & "<a href="<%=strPageName%>">Login</a>"

how this can be done.

View Replies View Related

Href + Outlook

Is it possible to create a link to open outlook (Client side) to open a particular folder
here is the code i am trying to use unsuccessfully :

<a href="outlook://Public%20Folders/All%20Public%20Folders/P/W/C/Conf
%20Room/~S%20C%20R">Conference Room 1</a>

Basically what i want to happen is that when a user clicks on the web link that it opens the meeting room which is in a public folder in outlook application (not the web interface outlook.

View Replies View Related

Href Statement

My href statement as follows isn't working and in fact prohibits the rest of the asp on the page from working. Code:

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved