Update current date in mysql using Update form DW CS4 PHP

I have a field called datePosted that is set to curdate in the database.  What I want to do is when the checkbox on this form called approved is checked, and the form is submitted, I want that dateApproved field to update to the current date in the database.  When I have tried it, it says zero.  I have tried setting a variable and using now() but cant get it to change on update.
Here is the form
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
    <table align="center">
      <tr valign="baseline">
        <td nowrap="nowrap" align="right">JobName:</td>
        <td><input type="text" name="jobName" value="<?php echo htmlentities($row_rs_crave['jobName'], ENT_COMPAT, 'UTF-8'); ?>" size="32" /></td>
      </tr>
      <tr valign="baseline">
        <td nowrap="nowrap" align="right" valign="top">Description:</td>
        <td><textarea name="description" cols="50" rows="5"><?php echo htmlentities($row_rs_crave['description'], ENT_COMPAT, 'UTF-8'); ?></textarea></td>
      </tr>
      <tr valign="baseline">
        <td nowrap="nowrap" align="right">State:</td>
        <td><select name="state">
          <option value="h" <?php if (!(strcmp("h", htmlentities($row_rs_crave['state'], ENT_COMPAT, 'UTF-8')))) {echo "SELECTED";} ?>>hh</option>
        </select></td>
      </tr>
      <tr valign="baseline">
        <td nowrap="nowrap" align="right">FleetID:</td>
        <td><input type="text" name="fleetID" value="<?php echo htmlentities($row_rs_crave['fleetID'], ENT_COMPAT, 'UTF-8'); ?>" size="32" /></td>
      </tr>
      <tr valign="baseline">
        <td nowrap="nowrap" align="right">Approved:</td>
        <td><input type="checkbox" name="approved" value=""  <?php if (!(strcmp(htmlentities($row_rs_crave['approved'], ENT_COMPAT, 'UTF-8'),""))) {echo "checked=\"checked\"";} ?> /></td>
      </tr>
      <tr valign="baseline">
        <td nowrap="nowrap" align="right">DatePosted:</td>
        <td><input type="text" name="datePosted" value="<?php echo htmlentities($row_rs_crave['datePosted'], ENT_COMPAT, 'UTF-8'); ?>" size="32" /></td>
      </tr>
      <tr valign="baseline">
        <td nowrap="nowrap" align="right"> </td>
        <td><input type="submit" value="Update record" /></td>
      </tr>
    </table>
    <input type="hidden" name="jobid" value="<?php echo $row_rs_crave['jobid']; ?>" />
    <input type="hidden" name="MM_update" value="form1" />
  </form>
And they sql
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE crave SET jobName=%s, `description`=%s, `state`=%s, fleetID=%s, approved=%s, datePosted=%s WHERE jobid=%s",
                       GetSQLValueString($_POST['jobName'], "text"),
                       GetSQLValueString($_POST['description'], "text"),
                       GetSQLValueString($_POST['state'], "text"),
                       GetSQLValueString($_POST['fleetID'], "int"),
                       GetSQLValueString(isset($_POST['approved']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString($_POST['datePosted'], "date"),
                       GetSQLValueString($_POST['jobid'], "int"));

Change the SQL like this:
// Check whether the approved checkbox has been selected
$_POST['approved'] = isset($_POST['approved']) ? 1 : 0;
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE crave SET jobName=%s, `description`=%s,
`state`=%s, fleetID=%s, approved=%s, datePosted=%s WHERE jobid=%s",
                       GetSQLValueString($_POST['jobName'], "text"),
                       GetSQLValueString($_POST['description'], "text"),
                       GetSQLValueString($_POST['state'], "text"),
                       GetSQLValueString($_POST['fleetID'], "int"),
                       GetSQLValueString(isset($_POST['approved']), "defined","NOW()","approved"),
                       GetSQLValueString($_POST['datePosted'], "date"),
                       GetSQLValueString($_POST['jobid'], "int"));
What that does is check whether the approved checkbox has been selected. If it has, $_POST['approved'] is set to 1 (true); if not, it's set to 0 (false).
In the GetSQLValueString() function, the value is set to NOW() if the checkbox has been selected. Otherwise, the existing value in the approved column is reassigned.

Similar Messages

  • Show active current date and time in a Form continuously

    Hi,
    I am use Oracle Form 10.1.2 in Windows 2000.
    Can we show an active current date and time in a Form continuously?
    Perhaps in the main menu form.
    So the user can see the moving time, instantly when the time change (withour pushing F5 for refreshing the form)
    23-Sep-2006 06:00
    -- one minute later will show
    23-Sep-2006 06:01
    -- one minute later will show
    23-Sep-2006 06:02
    -- and so on
    Any help is appreciated.
    Many thanks,
    Buntoro

    Here is a quick, untested suggestion that sketches out one way of approaching this.
    If you only require updates every 60 seconds, you can use the TIMER built-in to create a repeating timer with a sixty-second delay. Each time the timer expires, update a text item to reflect the current time (obtained by selecting SYSDATE from DUAL on the database.)
    If the time is to be updated precisely when the minute changes, use two timers -- the same one described above, and a one-shot. Before you create either timer, run the following query:
       SELECT 60-TO_NUMBER(TO_CHAR(SYSDATE, 'ss')) FROM DUALThis will give the number of seconds remaining until the minute changes. Use this value to set the duration of the one-shot timer. When it expires, create the repeating sixty-second timer.
    There is a good possibility that this method will not be terribly precise, depending on factors like server resources, user load and network distance. A more network-friendly approach would be to use a JavaBean that relies on the PC's system timer to track the passage of time, and calculates server time based on the observed time difference between PC & server.
    Hope this helps,
    Eric Adamson
    Lansing, Michigan

  • Save data to mysql using AS3 + Flash Builder(flex) OR AS3+AMFPHP? or AS3

    Hi,
    i just want to confirm with you guys about saving data to mysql using Action script 3.
    I am now developing RPG game that user can save data again and again to the MySQL.
    I searched on the net and found few solutions:
    AS3 alone using URL Loader
    AS3 + Flex +Php to save data to mysql
    AS3 + AMFPHP to save data to mysql
    This make me confused as there are too many options but i do not know which one is better for me
    or what are their limitations...
    Could you guys help me on this?

    For developing you can use the server (install like any other software), but the Zend framework is nothing more than php files, so all you need to do is upload the framework to you hosting server and all should be well.. You may have to configure a few things, but you should be able to do that yourself.
    There's plenty of documentation on installing and configuring Zend on their website.
    So, only get the server edition if you don't already have a dev server (on you computer) installed, like Apache. Otherwise, just grab the framework:
    http://framework.zend.com/download/latest
    Select "minimal package" on the page above to only get the framework (no install). Or grab both and see what each one does but the minimal package is what you need to upload to your hosting server.
    As for where Flex/Flash Builder comes in.. FB is the tool you use to create a Flash/Flex application.
    Zend, AMFPHP, etc.. is used to communicate with your backend from your application, using RemoteObject
    RemoteObject API
    http://livedocs.adobe.com/flex/3/langref/mx/rpc/remoting/RemoteObject.html
    Using RemoteObject components
    http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html

  • Problem with getting current date and time using oracle.jbo.domain.Date

    I`d like to get current date and time using oracle.jbo.domain.Date method getCurrentDate(), but it always return current date and 12:00:00. I also need to get the current time.

    I think you should use java.sql.Timestamp domain.
    (And set database type to TIME or DATETIME.)
    Jan

  • Dock icon update current date without having iCal running?

    Hello, minor thing - I typically leave my computer on all the time. I don't use iCal too often but I have the icon in the dock. I am wondering if there is a way to have the dock icon update without launching iCal? It would be nice that the current date is displayed when I view the dock. I guess I could schedule iCal to be launched and then quit once a day. I don't know, any suggestions?

    I have a few suggestions.
    1) This is a free alternative: http://www.objectpark.net/mcc.html
    2) Search MacOSXhints for a way to change the dock date daily. I read a hint there a few months ago for doing this: http://www.macosxhints.com/
    3) Wait for the next iCal as I would be surprised if Apple doesn't build this in to iCal 3 given how many times folks ask this question.
    4) You'll like suggestion #1.

  • How to UPDATE MASTER DATA RECORD PA0377 using FM HR_INFOTYPE_OPERATION

    How to UPDATE MASTER DATA RECORD IN INFOTYPE 0377 DIRECTLY using function module HR_INFOTYPE_OPERATION ? When i use operation = 'MOD'  im getting an ERROR as NO DATA STORED FOR 0377 IN SELECTION PERIOD.
           Can anyone please help me how to use HR_INFOTYPE_OPERATION to UPDATE MASTER DATA RECORD.
    Thanks,
    Karthi.

    Hi,
    please check this code
    it is very useful
    infotypes: 0105.
    parameters: p_pernr type p0105-pernr,
                p_subty type p0105-subty,
                p_begda type p0105-begda,
                p_endda type p0105-endda,
                p_opera type pspar-actio,
                p_usrid type p0105-usrid,
                p_commt as checkbox.    "Useful only when NO_COMMIT is 'X'
    data: w_return type bapireturn1,    "Error handling data
          w_key type bapipakey,         "If record has been created or changed the created/ changed
                                        "record's key (PSKEY) will be populated
          v_message type string.        "For printing returned messages
    call function 'BAPI_EMPLOYEE_ENQUEUE'
      exporting
        number = p_pernr
      importing
        return = w_return.
    if w_return is initial. "Employee is not locked
      p0105-pernr = p_pernr.
      p0105-subty =
      p0105-usrty = p_subty.
      p0105-begda = p_begda.
      p0105-endda = p_endda.
      p0105-usrid = p_usrid.
    *Calls Internally HR_MAINTAIN_MASTERDATA
      call function 'HR_INFOTYPE_OPERATION'
        exporting
          infty         = '0105'
          number        = p_pernr
          subtype       = p_subty
          validityend   = p_endda
          validitybegin = p_begda
          record        = p0105
          operation     = p_opera
          dialog_mode   = '0'
          nocommit      = 'X'
        importing
          return        = w_return
          key           = w_key.
    endif.
    if w_return is not initial.
      message id w_return-id type w_return-type number w_return-number
              with w_return-message_v1 w_return-message_v2 w_return-message_v3
              w_return-message_v4 into v_message.
      case w_return-type.
        when 'A' or 'E'.
          format color col_negative. write:/ v_message.
        when others.
          format color col_heading. write:/ v_message.
      endcase.
      call function 'BAPI_EMPLOYEE_DEQUEUE'
        exporting
          number = p_pernr.
    else.
      format color col_positive. write:/ 'Record Updated Successfully.'.
      if w_key is not initial.
        write:/ 'Key contains',
              / 'Personnel Number:', w_key-employeeno,
              / 'Subtype (absence type):', w_key-subtype,
              / 'Start date of Absence:', w_key-validbegin,
              / 'End date of Absence:', w_key-validend.
      endif.
      commit work.
    endif.
    Thanks and regards
    durga.K

  • I recently purchased a MacBook Pro and transferred data from my MacBook via Ethernet cable. I did not consolidate my accounts and kept using my MacBook. Can I update the data transfer now using Ethernet and can I consolidate my accounts?

    I recently purchased a MacBook Pro and transferred data from my MacBook using Migration Assistant via Ethernet cable.  I was confused about consolidating my accounts, so I continued to use my old MacBook.  Can I now update the data transfer using the same process and begin using my new MacBook Pro exclusively?  How do I consolidate my existing accounts?
    Thank you.

    Of course. It does everything it did before Yosemite. You just won't be able to send or receive SMS messages with it.

  • How much of my data does Genius use updating my library ?

    I have say 100gb of music in my Itunes library and I would like to know how much of my data usage Genius uses when it first updates?

    Welcome to AD!
    I doubt any of us other users will be able to answer that. The algorithms for that genius feature are like a trade secret, aren't they?
    All I can say for certain is that a library of around 100 tracks won't provide any genius mixes.

  • Update file date/time stamp using java

    Let me explain you what I am going through:-
    I have created a java based installer using Jexpress tool and after I do the installation of my files, the files takes the current date rather then taking the date when it was created or modified.
    Everything goes into JAR and I heard that Jar file do not retain the date/time stamp of the file.
    I would like to know if we can change the date and time stamp of the files using Java.
    Is there any method to do that or can we do this by writing the java class?
    Thank You
    Mehul

    Did you check it?
    I did.
    $ jar cvf ~/ui *.m3u
    added manifest
    adding: Amollhgv.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand1.m3u(in = 56) (out= 27)(deflated 51%)
    adding: Brand2.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand3.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand4.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand5.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Brand6.m3u(in = 42) (out= 24)(deflated 42%)
    adding: Edurhgv.m3u(in = 42) (out= 24)(deflated 42%)
    $ unzip -l ~/ui
    Archive:  /home/ijbalazs/ui
      Length     Date   Time    Name
            0  12-04-03 17:53   META-INF/
           71  12-04-03 17:53   META-INF/MANIFEST.MF
           42  08-26-02 01:03   Amollhgv.m3u
           56  11-22-98 01:15   Brand1.m3u
           42  08-26-02 01:04   Brand2.m3u
           42  08-26-02 01:04   Brand3.m3u
           42  08-26-02 01:04   Brand4.m3u
           42  08-26-02 01:04   Brand5.m3u
           42  08-26-02 01:04   Brand6.m3u
           42  08-26-02 01:04   Edurhgv.m3u
          421                   10 files

  • How to display the Current Date on page using ADF Components

    Hi,
    Is there any way to display the system date on a page developed using ADF Components.
    I am thinking of writing the java code to display the date. Just wanted to check is there any pre-defined component of ADF that I can make use of.
    Could anyone tell me how to do this using ADF components?
    Thanks in advance.
    Sivaji....

    Please refer the below link.
    Prompt  with  default  date   (  currentdate-1  and current date-8)
    http://www.dagira.com/2008/07/15/how-can-i-make-today-my-default-prompt-value/
    http://www.dagira.com/2008/07/21/using-a-magic-date-value-in-prompts/
    Regards,
    Bilahari

  • Insert current date/time and username into form.

    Apologies for newbie question.
    I have a form based on table Customer, within the table I have username and modifiedDate columns. How can I populate these text fields with the current user and current date/time ?
    Thanks.

    Excellent, thanks for the fast response. I had this working and then tried in on a new form and now it fails to populate the desired fields.
    I have created a process named "Insert date and username", Type P/SQL anonymous block. On Load - After Header, Once Per Page Visit.
    select :APP_USER, to_char(SYSDATE,'DD-MON-YYYY HH24:MI:SS')
    INTO :P16_USERNAME, :P16_MODIFIEDDATE
    from dual;
    Sorry for the hand holding!
    Jason
    Edited by: Jason S (UK) on Apr 24, 2013 6:57 AM

  • Importing form data per XML - Using the form interface?

    Hi!
    I'm developing interactive forms by adobe and I want to import my form data per XML file. The xml file and the email are created by my pdf document.
    Now this xml file has to be parsed by a report or something like this.
    Is it possible to use the form interface, I implemented, or do I have to parse it manually?
    I think it has to work with this interface because it makes the pdf and it "knows" what to import/export.
    Am I wrong with my suspicions or can you help me with this problem?
    Thanks & greets,
    Philip Gillißen

    I'm pretty impressed of Adobe and their stuff (I do NOT refer to the community), how helpful they are.
    Perhaps I didn't understand  the meaning on the offical customer support website, stating:
    The best way to contact us...  
    Ask our experts 
    Our community and staff are at your service 24/7
    Even worst, their is a similar question from 25/09/2013 (http://forums.adobe.com/message/5711946#5711946) and no feedback form Adobe stuff at all.
    Great service guys!
    Thanks a lot!

  • Is it possible to add more data to a prepaid plan before the current data allowance is used up?

    My data is nearly used up and I will b eon the road when it is completely used up.  I would like to add more now so that I do not have to pull off the road to login and add more data to my plan.  The website is very poorly designed and of it is possible to do this I can't find where it is.  Please do not tell me to call the CS line like you have everyone else who has asked similar questions.  If so please state that this is the only way to add more data to a plan/account as I don't have the availability to sit on hold for 40 minutes...  Thanks

        TSchlottman, we want that process to be as easy as possible for you. Happy to provide direction on how to change your plan. To change your minutes, text or data: Go to the Change Minutes, Text or Data page in My Verizon. If you have multiple lines on your account with separate plans, select the plan you’d you like to make a change to, and click Next. Select the data plan you’d like to have and click Next at the bottom of the page. Select the date when you want your changes to take effect and click Next. Review your changes and click Submit Changes.
    BrianP_VZW
    Follow Us on Twitter @VZWSupport

  • What data to return when submitting form to a php script?

    Been trying to figure this out for few days now. Been googling it up and found nothing.
    I made a form with livecycle designer, put a http submit button to post data to my php script and when I open it up on acrobat reader and try to submit it, I get an error about content-type not being correct etc.
    What kind of content-type should I be returning then? text/plain, text/html and application/pdf with 0 lenght content doesn't seem to cut it. Can I disable whole return-check as I really dont have anything to return? Or can I somehow send an "success/failure" pop-up or something?

    Thank you George,
    I added the line: header('x', TRUE, 204); to my PHP script per your suggestion and found that I get an error thrown "invalid server response" when using acrobat reader or acrobat pro 9. No new window is loaded and the pdf user's experience is not changed (except for the error message).
    Without the added line, I get the error "no input file page data" thrown.  Since I'm not returning anything to the browser that is expected but not wanted.
    In either case, the data fields are captured and saved by my PHP script. It seems that acrobat requires a response from the server otherwise it is not happy. I can't see a way that I can turn off error messages to avoid this.

  • Update Header Data in SMSY using LMDB

    Where in the LMDB can I update the "Production" checkbox that exists in SMSY on the Header Data for a Landscape Component? All of my systems (DEV, QA1, QA2 PROD) exist in both SMSY and the LMDB as well as in the TMS of the manage system. The QA2 and PROD are virtual systems in TMS.

    Hi Erin
    You can try in Transaction LMDB, there you have the Role,,

Maybe you are looking for