php insert update delete code example
Example: php insert update delete
//Best practice for performing crud operations in php is to have them in your db
//create stored procedures for each operation then call them in php
//preferably using php pdo
<?php
$dbname = 'test_db';
$host = '127.0.0.1';
$user_name = 'root';
$user_pass = '';
$con = new PDO("host=$host;dbname=$dbname", $user_name, $user_pass);
$stmt = $con->prepare('CALL [procedure_name]');
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
while($res = $result){
echo $res['FieldName'];
}