SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2010
    Location
    ONS
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql_affected_rows is DDL or DML statement ?

    Today, my senior asked me a mysql_query to get number of affected rows, I said that’s very easy “mysql_affected_rows”, but suddenly he asked by which it is done, by using DDL or by DML? I have never heard that a query is DDL or DML.
    I love to help and also to get helped.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,015
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    a query is either DDL or DML

    but mysql_affected_rows is neither, it is a php function
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Zealot
    Join Date
    Nov 2010
    Location
    ONS
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Rudy Sir.
    But the mysql query which in running in backend, and when its outputs comings that "1 row(s) affected", then to which type that backend query belong ?
    Is it DDL or DML?
    I love to help and also to get helped.

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,015
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by mohansinfh View Post
    Is it DDL or DML?
    depends

    which query are you talking about? can i see it?
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Zealot
    Join Date
    Nov 2010
    Location
    ONS
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sir, I am talking about the query which is run in phpmyadmin, when we delete some record in a table. Then it comes in the bottom, that "1 row(s) affected". Is that DDL or DML?
    I think that's DML because that message came because Data is manipulated.
    I love to help and also to get helped.

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,015
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by mohansinfh View Post
    I think that's DML because that message came because Data is manipulated.
    you are correct -- DELETE is DML
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    SitePoint Member
    Join Date
    Mar 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i also think its DML (data manipulation language)

    using DML commands like insert,delete data is manipulated.


Bookmarks

Posting Permissions

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