DELETE query and not only

    Date: 10/06/05 (PHP Community)    Keywords: mysql, sql

    Do someone know what's wrong with the following code:

    //deleting
    if ($delete) {
            foreach ($record as $num) {
            $query=mysql_query ("DELETE FROM $table WHERE ID='$num'");
            }
            printf ("Records deleted: %d\n
    ", mysql_affected_rows($query));         }


    As you probobly can see, I need it to print how many rows were deleted and it returns 0 even when I"m 100% sure several rows were deleted.

    Source: http://www.livejournal.com/community/php/351399.html

« Tools to combat Spam || unit testing »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home