Deleting all records from MySQL table using phpMyAdmin

1149020 pts.
Tags:
MySQL
phpMyAdmin
I'm currently using a WAMP server. When I'm trying to delete all of my records in a MySQL table using phpMyAdmin, it keeps deleting only one record at a time. I need to delete all the records. How can I do that?
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

The DELETE statement is used to delete records from a table. This code will delete data of existing record using PHP.

<?php

$con = mysqli_connect(“192.168.1.51″,”username”,”password”,”first_db”);

$record = “DELETE FROM MyTable WHERE id=1”;

if ($con->query($record) === TRUE) {

    echo “Record deleted successfully”;

} else {

    echo “Error: ” . $record . “<br>” . $con->error;

}

 

$con->close();

?>


Check this helpful link to know about mysql database

I hope it will help you

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • carlosdl
    To answer the question we would need to know exactly what you are doing.

    I don't know phpMyAdmin, but if it allows you to fire SQL commands against the database, you can simply do this:

    DELETE from your_table;
    84,975 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: