Search
 
SCRIPT & CODE EXAMPLE
 

PHP

delete mysql php

$query = $conn -> query("DELETE FROM table_name WHERE some_column = some_value");
if ($query){
	echo "success";
}
Comment

PHP MySQL Delete Data

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

// sql to delete a record
$sql = "DELETE FROM MyGuests WHERE id=3";

if ($conn->query($sql) === TRUE) {
  echo "Record deleted successfully";
} else {
  echo "Error deleting record: " . $conn->error;
}

$conn->close();
?>
Comment

how to delete data from database in php

TRUNCATE TABLE [table_name]
Comment

PREVIOUS NEXT
Code Example
Php :: how increase php upload size in wordpress 
Php :: php time 
Php :: php implode keys 
Php :: php array check 
Php :: laravel bootstrap-auth setup 
Php :: laravel price database 
Php :: str_replace smarty template 
Php :: php validate file type 
Php :: how can we check in the table in comma separated values in laravel 
Php :: php value to javascript variable laravel blade 
Php :: command to create model with migration in laravel 
Php :: enum artisan codwe 
Php :: php ternary shorthand 
Php :: php rand vs mt_rand 
Php :: symfony get container static 
Php :: create a new project from cli laravel 
Php :: check if array contains only unique values php 
Php :: Redirect to external domain in Laravel 
Php :: string compare in php 
Php :: and php 
Php :: laravel store array to cache 
Php :: create controller with model resources and request command in laravel 
Php :: __dir__ in php 
Php :: get specific columns using with() function in laravel eloquent 
Php :: php variable in echo 
Php :: laravel blade @selected 
Php :: laravel carbon get day name 
Php :: wordpress display post categories 
Php :: php loop array 
Php :: php array order alphabetically 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =