Developer Center

DELETE

The methods required to delete a row from a table in the database are described below.

DELETE

It written as WDB::delete(arg1) 

You must write the table name in the arg1 value.

Returns the class content as the return value.

WHERE

For detailed information, check out the "Create a Query" document.

RUN

It written as WDB::run() 

When executed right after the methods described above, it send the query to the database and deletes the row.

As the return value, the result of the operation is returned as "boolean" data type.

Sample PHP Code

<?php
    $operation = WDB::delete("table1");
    $operation->where("field","=","pear");
    $run       = $operation->run();
    if($run)
    {
        echo "Successful";
    }
    else
    {
        echo "Error : ".$operation->getErrorMessage();
    }
    
?>
 
UPDATE Number of Rows

Do you have any questions?

Feel free to contact us
Contact Us
Copyright © 2024. All Rights Reserved.
Join Our Discord Channel
Top