Commit 5cd95abd authored by Yasaswini Chandolu's avatar Yasaswini Chandolu

php code for profile

parent de240669
Pipeline #33962 passed with stage
in 18 seconds
<?php
$current_user = wp_get_current_user();
/**
* @example Safe usage:
* $current_user = wp_get_current_user();
* if ( ! $current_user->exists() ) {
* return;
* }
*/
echo 'Username: ' . $current_user->user_login . '<br />';
echo 'User email: ' . $current_user->user_email . '<br />';
$servername = "localhost";
$username = "swecha";
$password = "swecha";
$dbname = "swechadb";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql="select event from eventattended where email='$current_user->email'";
$result=mysqli_query($conn,$sql);
$check=mysqli_num_rows($result);
if ($check > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo $row['meta_key'].":" . $row['meta_value']. "<br>" ;
}
} else {
echo "0 results";
}
$conn->close();
?>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment