www.webdeveloper.com
Results 1 to 6 of 6

Thread: Mysql query

  1. #1
    Join Date
    Aug 2013
    Posts
    40

    Mysql query

    Hi All,

    Can it be possible in mysql to fetch the data which is modified , I mean i only want to see the data which is modified by user .


    Let tell me what should be the mysql query for this requirement


    Thanks In Advance

    Regards,

    Ashish Sood

  2. #2
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    638
    What do you mean by "modified"? Data that was just modified in the last query you ran? Or data that has been modified since a certain date/time? Unless you have stored a datetime value on the record and can use that as a reference point how do you expect to recognized changed data?

  3. #3
    Join Date
    Aug 2013
    Posts
    40
    Let me explain you, I have a table name "orders", which contain following field, OID, ONAME, DATE, STATUS, TIMESTAMP.

    Now i want to fetch only those order whose timestamps has changed recently(current date).

    Thanks

  4. #4
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    638
    This makes SOOO much more sense. Why didn't you say so before???


    Of course you can do what you ask. Simply compose your query and check for the timestamp field greater than a specific date/time value.

  5. #5
    Join Date
    Aug 2013
    Posts
    40
    Thanks for your reply.


    Below is my current mysql query.

    $selectreq = mysql_query ("SELECT * FROM orders WHERE STATUS !='COMPLETED' AND STATUS !='CANCELLED'");
    I want to integrate my requirement into this existing query. can it be possible, If yes, then could you please, show me with example.

  6. #6
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    638
    and timedate > "2013-12-31 00:00:00" should do it although you might have to tinker with the format of the value.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles