<a href="https://console.cloud.google.com/apis/credentials">Get Your Api Credentials Here</a> <a href="https://calendar.google.com/calendar">Get your Calender ID</a> <?php include_once("wp-load.php"); function get_calender_events() { $params = array(); /*Get current date*/ $current_date = date('Y-m-d H:i:s'); /*Convert it to google calendar's rfc_format */ $rfc_format = date("c", strtotime($current_date)); $params[] = 'orderBy=startTime'; $params[] ='maxResults=100'; $params[] = 'timeMin='.urlencode($rfc_format); $url_param = ''; foreach($params as $param) { $url_param.= '&'.$param; } $calender_id = "calender_id"; $client_key = "client_key"; $url = "https://www.googleapis.com/calendar/v3/calendars/".$calender_id."/events?key=".$client_key."&singleEvents=true".$url_param; $list_events = wp_remote_post($url, ...
<?php
// Database Connection
$host="localhost";
$uname="root";
$pass="";
$database = "samrat";
$connection=mysql_connect($host,$uname,$pass);
echo mysql_error();
//or die("Database Connection Failed");
$selectdb=mysql_select_db($database) or
die("Database could not be selected");
$result=mysql_select_db($database)
or die("database cannot be selected <br>");
// Fetch Record from Database
$query="SELECT jos_users.email,jos_users.name,jos_vm_user_info.first_name,jos_vm_user_info.last_name,jos_vm_user_info.middle_name,jos_vm_user_info.phone_1,jos_vm_user_info.phone_2,jos_vm_user_info.address_1,jos_vm_user_info.city,jos_vm_user_info.state,jos_vm_user_info.country,jos_vm_user_info.zip
FROM jos_users LEFT JOIN jos_vm_user_info
ON jos_users.id = jos_vm_user_info.user_id";
$query="SELECT jos_users.email,jos_users.name,jos_vm_user_info.first_name,jos_vm_user_info.last_name,jos_vm_user_info.middle_name,jos_vm_user_info.phone_1,jos_vm_user_info.phone_2,jos_vm_user_info.address_1,jos_vm_user_info.city,jos_vm_user_info.state,jos_vm_user_info.country,jos_vm_user_info.zip
FROM jos_users,jos_vm_user_info
WHERE jos_users.id = jos_vm_user_info.user_id";
$output = "";
$table = "jos_users"; // Enter Your Table Name
$sql = mysql_query($query);
$columns_total = mysql_num_fields($sql);
// Get The Field Name
for ($i = 0; $i < $columns_total; $i++) {
$heading = mysql_field_name($sql, $i);
$output .= '"'.$heading.'",';
}
$output .="\n";
// Get Records from the table
while ($row = mysql_fetch_array($sql)) {
for ($i = 0; $i < $columns_total; $i++) {
$output .='"'.$row["$i"].'",';
}
$output .="\n";
}
// Download the file
$filename = "myFile.csv";
header('Content-type: application/csv');
header('Content-Disposition: attachment; filename='.$filename);
echo $output;
exit;
?>
// Database Connection
$host="localhost";
$uname="root";
$pass="";
$database = "samrat";
$connection=mysql_connect($host,$uname,$pass);
echo mysql_error();
//or die("Database Connection Failed");
$selectdb=mysql_select_db($database) or
die("Database could not be selected");
$result=mysql_select_db($database)
or die("database cannot be selected <br>");
// Fetch Record from Database
$query="SELECT jos_users.email,jos_users.name,jos_vm_user_info.first_name,jos_vm_user_info.last_name,jos_vm_user_info.middle_name,jos_vm_user_info.phone_1,jos_vm_user_info.phone_2,jos_vm_user_info.address_1,jos_vm_user_info.city,jos_vm_user_info.state,jos_vm_user_info.country,jos_vm_user_info.zip
FROM jos_users LEFT JOIN jos_vm_user_info
ON jos_users.id = jos_vm_user_info.user_id";
$query="SELECT jos_users.email,jos_users.name,jos_vm_user_info.first_name,jos_vm_user_info.last_name,jos_vm_user_info.middle_name,jos_vm_user_info.phone_1,jos_vm_user_info.phone_2,jos_vm_user_info.address_1,jos_vm_user_info.city,jos_vm_user_info.state,jos_vm_user_info.country,jos_vm_user_info.zip
FROM jos_users,jos_vm_user_info
WHERE jos_users.id = jos_vm_user_info.user_id";
$output = "";
$table = "jos_users"; // Enter Your Table Name
$sql = mysql_query($query);
$columns_total = mysql_num_fields($sql);
// Get The Field Name
for ($i = 0; $i < $columns_total; $i++) {
$heading = mysql_field_name($sql, $i);
$output .= '"'.$heading.'",';
}
$output .="\n";
// Get Records from the table
while ($row = mysql_fetch_array($sql)) {
for ($i = 0; $i < $columns_total; $i++) {
$output .='"'.$row["$i"].'",';
}
$output .="\n";
}
// Download the file
$filename = "myFile.csv";
header('Content-type: application/csv');
header('Content-Disposition: attachment; filename='.$filename);
echo $output;
exit;
?>
Comments
Post a Comment