How to delete (drop) a table in MySQL using MySQLi in PHP

1 Answer

0 votes
$db_host        = 'localhost';
$db_user        = 'root';
$db_password    = '';
$db_name        = 'allonpage';

$con = new mysqli('localhost', $db_user, $db_password, $db_name);

if ($con->connect_error) 
    die('Connection Error: ' . $con->connect_error);
    
$con->query("DROP TABLE IF EXISTS images2");

$con->close();


/*
run: 


*/

 



answered Jul 7, 2016 by avibootz

Related questions

2 answers 258 views
2 answers 178 views
1 answer 183 views
183 views asked Jul 13, 2014 by avibootz
1 answer 168 views
...