in php mysql is it possible to store the table data into a php file code example

Example 1: insert php code

<?php
$host = "localhost";
$username = "username";
$pass = "";
$db="furniture";


// Create connection
$conn=mysqli_connect($host,$username,$pass,$db);

if(!$conn){
  die("Data connection error");
}
?>

Example 2: print data that will be inserted in the database

$key = strtoupper(c_security::random_string(22));
$c_con->query("INSERT INTO keys(key, days, used) VALUES ('$key',".c_security::anti_sql_string($_POST["daysammount"])."', '0')");
echo $key;
i think like that

Tags:

Php Example