Search
 
SCRIPT & CODE EXAMPLE
 

PHP

delete in crud php

if (isset($_GET['del'])) {
	$id = $_GET['del'];
	mysqli_query($db, "DELETE FROM info WHERE id=$id");
	$_SESSION['message'] = "Address deleted!"; 
	header('location: index.php');
}
Comment

delete in crud php

// ... 

if (isset($_POST['update'])) {
	$id = $_POST['id'];
	$name = $_POST['name'];
	$address = $_POST['address'];

	mysqli_query($db, "UPDATE info SET name='$name', address='$address' WHERE id=$id");
	$_SESSION['message'] = "Address updated!"; 
	header('location: index.php');
}
Comment

delete in crud php

<button class="btn" type="submit" name="save" >Save</button>
Comment

delete in crud php

// ...
<body>
<?php if (isset($_SESSION['message'])): ?>
	<div class="msg">
		<?php 
			echo $_SESSION['message']; 
			unset($_SESSION['message']);
		?>
	</div>
<?php endif ?>
Comment

PREVIOUS NEXT
Code Example
Php :: utf8 php 
Php :: php remove leading zeros 
Php :: php begin 
Php :: get static front page 
Php :: wp_query order by taxonomy 
Php :: get app url in laravel 
Php :: laravel csrf token mismatch postman 
Php :: laravel delete 
Php :: how to remove null values in array php 
Php :: PHP File Read Modes 
Php :: enable gd php 
Php :: crul in laravel 
Php :: for each php 
Php :: PHP OOP - Classes and Objects 
Php :: send attachment in mail php 
Php :: IlluminateDatabaseQueryExcep Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`)) laravel 
Php :: laravel 6 get user id 
Php :: index.php wont load as main 
Php :: how to collapse array in laravel 
Php :: php check for null 
Php :: string to array in php 
Php :: laravel composite unique key 
Php :: php implode array 
Php :: comment in php 
Php :: subtract string php 
Php :: php convert to boolean 
Php :: php echo selected option 
Php :: show php all errors 
Php :: php artisan orderByDesc 
Php :: find substring in string php 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =