DROP Query using PDO

PHP PDO & MYsQL We can drop or delete table from Database by using DROP query.

  • PDO: rowCount() with INSERT, DROP & DELETE query

Here is an example.
Database connection is available at config.php file.
require "config.php"; // database connection 
$sql=$dbo->prepare("DROP TABLE  student_del ");

After the query execution we will add message saying success or print error message in case of failure.
require "config.php"; // database connection 
$sql=$dbo->prepare("DROP TABLE  student_del ");

echo " Table deleted ";
In the above code we have used database connection code inside config.php file.
PDO ReferencesDelete Records

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net




    What about if I want to TRUNCATE A TABLE how would I do that? cheers


    Details about the TRUNCATE command is here.

    Post your comments , suggestion , error , requirements etc here

    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer