Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

how to add session data into mysql database from button

$conn = Connect(); //your MySQLDB connection

// extract values from session to variables
$username= $conn->real_escape_string($_SESSION['auth_user']['username']);
$email= $conn->real_escape_string($_SESSION['auth_user']['email']);
$phone= $conn->real_escape_string($_SESSION['auth_user']['phone']);

//query execution
$query = $conn->prepare("INSERT into loginDetails(username,email,phone) VALUES (?, ?, ?)");
$query->bind_param("sss", $username, $email, $phone); 
$query->execute();
 
PREVIOUS NEXT
Tagged: #add #session #data #mysql #database #button
ADD COMMENT
Topic
Name
6+2 =