sql help

GT9

Well-known member
  • Jun 22, 2013
    1,564
    167
    63
    [email protected]
    මචංල ටේබල් එකකට එක සැරේ rows කීපයක් insert කරනකොට affected rows වල 1ය කියල එන්නේ ඇයි? rows කීපයක්ම එක සැරේ ඉන්සර්ට් උනානම් ඒ ගාන එන්න ඕන නේද? :D
     
    • Like
    Reactions: twisted

    GT9

    Well-known member
  • Jun 22, 2013
    1,564
    167
    63
    [email protected]
    do you see all your rows inserted in the table afterwards?

    ඔව් මචෝ. අවුල තියෙන්නේ මට හිතෙන්නේ මචං php වල affected rows දෙන්නේ අන්තිමට එයා එක්සිකියුට් කරපු එකේ රිසල්ට් එකට අදාලව. ලූප් එකකින් කරගත හැකි. :P
     

    Lakshan-Seram

    Well-known member
  • May 31, 2011
    24,714
    12,619
    113
    127.0.0.1:8080/Kandy
    PHP:
    $con = mysqli_connect('localhost', 'root', '','database');
    if (mysqli_connect_errno()){
      die('Error!');
    }
    $query = mysqli_query($con, "SELECT *      FROM `table`");
    $affected_rows = mysqli_affected_rows($con);
    $query = mysqli_query($con,"DELETE FROM `table` WHERE `k`=1");
    $affected_rows = mysqli_affected_rows($con);
    echo $affected_row;
    exit();
     

    GT9

    Well-known member
  • Jun 22, 2013
    1,564
    167
    63
    [email protected]
    PHP:
    $con = mysqli_connect('localhost', 'root', '','database');
    if (mysqli_connect_errno()){
      die('Error!');
    }
    $query = mysqli_query($con, "SELECT *      FROM `table`");
    $affected_rows = mysqli_affected_rows($con);
    $query = mysqli_query($con,"DELETE FROM `table` WHERE `k`=1");
    $affected_rows = mysqli_affected_rows($con);
    echo $affected_row;
    exit();

    elaz macho, wade godadaththa :) :D rep+
     

    kolavari

    Well-known member
  • Aug 11, 2012
    33,746
    1
    25,653
    113
    කැළෑ පොජ්ජේ
    මචංල ටේබල් එකකට එක සැරේ rows කීපයක් insert කරනකොට affected rows වල 1ය කියල එන්නේ ඇයි? rows කීපයක්ම එක සැරේ ඉන්සර්ට් උනානම් ඒ ගාන එන්න ඕන නේද? :D

    :yes::yes:


    insert into TestTable (item_name) values ('value 4'), ('value 5'), ('value 6'), ('value 7');

    /* Affected rows: 4 Found rows: 0 Warnings: 0 Duration for 1 query: 0.014 sec. */

    උබ ලුප් එකකින් වෙන්න ඇති ඉන්සර්ට් කරන්නේ..මෙහෙම එක කුවරී එකෙන් නෙමෙයි නේ? එතකොට ලුප් එකේ අවසානෙට එෆෙක්ටඩ් රෝව්ස් ගාන වෙන්නැති එන්නේ..:rolleyes:
     
    • Like
    Reactions: GT9

    GT9

    Well-known member
  • Jun 22, 2013
    1,564
    167
    63
    [email protected]
    :yes::yes:


    insert into TestTable (item_name) values ('value 4'), ('value 5'), ('value 6'), ('value 7');

    /* Affected rows: 4 Found rows: 0 Warnings: 0 Duration for 1 query: 0.014 sec. */

    උබ ලුප් එකකින් වෙන්න ඇති ඉන්සර්ට් කරන්නේ..මෙහෙම එක කුවරී එකෙන් නෙමෙයි නේ? එතකොට ලුප් එකේ අවසානෙට එෆෙක්ටඩ් රෝව්ස් ගාන වෙන්නැති එන්නේ..:rolleyes:

    ඔව් මචං. දැන් වැඩේ හරි. :D


    :D
     
    • Like
    Reactions: kolavari

    CustomerSupport

    Well-known member
  • Mar 21, 2016
    2,404
    1,515
    113
    :yes::yes:


    insert into TestTable (item_name) values ('value 4'), ('value 5'), ('value 6'), ('value 7');

    /* Affected rows: 4 Found rows: 0 Warnings: 0 Duration for 1 query: 0.014 sec. */

    උබ ලුප් එකකින් වෙන්න ඇති ඉන්සර්ට් කරන්නේ..මෙහෙම එක කුවරී එකෙන් නෙමෙයි නේ? එතකොට ලුප් එකේ අවසානෙට එෆෙක්ටඩ් රෝව්ස් ගාන වෙන්නැති එන්නේ..:rolleyes:
    :yes:

    Loop ekakin insert karanawanam performance walatath badu banis athi.
     

    CM_LK

    Active member
  • Oct 3, 2010
    714
    80
    28
    rows godak insert karanna line by line nam last row insert eka result eka thamai display wenna
    Ex :
    insert ;
    insert ;