The fastest easiest way to get it right.

Database Deletes

Database deletes are best done manually, using an skey value, but Andromeda does provide the SQLX_Delete function as well.

This function is documented for completeness, but Andromeda library code does not use it. Manually coded delete commands using skey, while perhaps more tedious to write, are much safer.
<?php
class x6example extends androX6 {
    function x6main() {
        $row = array(
            skey=>1234
        );
        SQLX_Delete('articles',$row);
    }    
}

The SQLX_Delete function creates a command that includes all of the fields provided in the $row parameter.

Providing an skey value in the $row is the only way to be certain that exactly one row will be deleted.

If your $row array contains values that would result in deleting half of the rows in a table -- then that is what will happen!

User Comments

There are no user comments yet on this page.


Add A Comment

Comments will not appear until after they are moderated. Comments are usually moderated within a few hours on weekdays, but may take longer on weekends and holidays.

Name or nickname: (This will appear with your comment)


Email (this will never be displayed)


Enter your comment here. Use [b] and [/b] for bold, [i] and [/i] for italic, and [pre] and [/pre] for code samples. All literal HTML and PHP that you enter will be escaped out and displayed as you enter it.


Home |  Documentation |  Download |  Credits |  Contact |  Login
Andromeda © Copyright 2004-2010, Licensed under the GPL Version 2