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.
does anyone know if there is a function to format date?When my date is extracted from database, it is in decimal format (ie.38233.72078), is there a way to convert this number to date formate using asp?
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 %>
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.
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?
I wrote an ASP prgram to insert a row into a MySQL database using data from a form. It works just fine, however is there a way to check a return code and trap any error that may occur (duplicate row error for example) so I can format and display a message in the browser instead of having the error just show up?
I've been looking in my ASP & MySQL books and searching on the web but can't find anything that sounds like what I want to do.
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:
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?
I have a form that collects the date and time of an event. I create a string to hold all of the data in the correct format for MySQL and it (the string) looks like this...
2007-03-03 17:30:00
I am then using CDate to convert the string to a DateTime type.
and since I am in the US it gets converted like this...
3/3/2007 5:30:00 PM
per my regional system settings...
I grabbed this code from the forums here which I have used before... Code:
1 to insert a record a record into a mysql database-table. 1 that reads the database-table and displays the records.
When I call them in seperate browser-windows, everything works fine. The problem rises when I use a menu-page and call the pages in an IFrame in the same browserwindow.
The newly added records from the form-frame, do not show up when I call the display frame.
I have to close my browser and reopen it to see the new records. There are no error-messages given. Code:
I have a form that pulls existing information from a database and allows users to edit it. Every field can be left blank if the user wishes.
I am having an issue with determining which SQL statement to run. There has to be an easier way to do this then what I am doing. For each filed I process the data this way:
SQL2="select * from 1985ClassList where MailingListID =" & Session("EID") set aData = oConn.execute(SQL2)
I am submitting a comment box from a form into a database field that I have declared as text (16). When I type in a small amount of information, it submits just fine, but when I enter a substantial amount of data then I receive an error. I've tried different field types, but I keep getting the same error.
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 's'.
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?
I want to insert the element selected by the user from the drop down box in the DB(Access).Once the user hits submit i want it to insert this in the DB + i want to update one of the fields from True to False . how can i perform both these at the same time?
The data that is entered into my website needs to be sent to someone else. Currently it is being put into a MySQL database. In addition to this, a third party needs this information. They have something set up on their website where I can do this:
I have no control over domain.com. How can I update the record, send the data to this URL, and then redirect the user back to the default page? Right now it just inserts the record and then redirects to the default page. I'm unsure as to how to do the URL bit. I would prefer if the user did not see the domain switch.
After the page (transactions.asp) loads I want to allow the user to enter the number of transactions into the provided textboxes. Then, when the user clicks submit, I need to have all the hidden fields as well as the number of transactions values inserted into the transactions table of my database?
I have attached the database should you have any questions about the db table values and fields. Please let me know if you have any questions or need more information or files.
can u tell me of a simple script i can use to do the following. I want a textbox to add a entry to the database with a submit button, then below all that the current database entrys are listed below also in textboxes with a UPDATE and DELETE button beside each entry.
Is it possible to change ASP's date function to a MySQL compliant (ie. year first; 2003/8/17) style without a lot of code?
Maybe I'm mis-guided. I have a website built in ASP and using MS SQL. I'm converting it all to MySQL, but I'd rather not have to rewrite all the instances where I do something like this...
ASP: Code:
Query = "SELECT SUM(Total) AS Totals FROM orders WHERE create_date BETWEEN '" & date & "' AND NOW()"
I have a problem that it's bothering me for some time now and i will need a lot of help from you. I don't know how easy or difficult it is to be done but i would appreciate any help.
I have an mssql 2000 db with table "table1". Attributes for "table1" are:
ID (Primary Key) field1 field2 field3 field4 field5 field6 field7
I'm trying through DreamWeaver MX to create a form through ASP and Text Fields, so that i can update "table1" through the form and also on another page to show the results of my table.
I have created a form which will be accepting 25 rows, each row having field1, field2, .., field7.
how can i make the function return true only if the execution is successfull (see bold red below)? Currently the function is returning true wheather it is successfull or not. Code:
how to declare session variables and use it in insert and update sql statements... the scenario is I have:
2 html forms 2 ASP FILES
I am able to trap data from the first form into the acces table..but my second form(which is continuation of first form) has a update query....(ie...it shld update the same record the one inserted from the 1st form )..both the forms work on table in access db
its an annonymus...questionnaite...therefore i am not trapping any user name or login id...but the requirement is the survey made shld be unique....as in no user shld be able to answer the questions twice.
having issues submitting dates to a mysql db, ive converted the database from access to mysql and im having issues submitting dates. this is what i have when submitting to access Code:
I have all of the dates I use in my tables stored as date in the YYYY/MM/DD format, with the columns set to DATE.
When I do any queries on the database (not usinf ASP) I get YYYY/MM/DD format returned.
When I do a recordset("datefield") ASP request I get D/M/YYYY returned. I have not asked anything to convert it, I have no idea where it is getting converted. It is a real pain, as I need to copy these dates through out the table, and they are getting returned in the wrong format.
I found some script that converts ASP to MySQL. Now I need to reverse that process.MySQL Order_Date is the field I need to convert.I have a select list for order nunber - 'order date Where order date = MYSQL date stored in db.Sounds simple enough, but is very difficult so far to implement.