PHP Code:
<?php
//Opens a connection to the Warta Database
try {
$wrd1 = new PDO('mysql:host=localhost; dbname=*****', '******', '*****');
$wrd1->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$cale = $wrd1->prepare(
"SELECT
start,
end,
repeat_freq,
repeat_int,
repeat_end,
allDay,
category_id,
description,
link,
venue,
address,
city,
state,
zip,
country,
contact,
contact_info,
access,
rsvp
FROM
wp_aec_event
");
//executes SQL statement
$cale->execute();
//Set into array
$result = $cale->fetchAll(PDO::FETCH_ASSOC);
print_r($result);
echo("\n");
//Opens a connection to the 1-sza Database
try {
$wrd2 = new PDO('mysql:host=localhost; dbname=*****', '*******', '**');
$wrd2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$cale1 = $wrd2->prepare(
"SELECT
start,
end,
repeat_freq,
repeat_int,
repeat_end,
allDay,
category_id,
description,
link,
venue,
address,
city,
state,
zip,
country,
contact,
contact_info,
access,
rsvp
FROM
wp_aec_event
");
//executes SQL statement
$cale1->execute();
//set into array
$result1=$cale1->fetchALL(PDO::FETCH_ASSOC);
print_r($result1);
echo("\n");
//testing out php array compare
$compare = array_diff($result, $result1);
print_r($compare);
}
catch (PDOException $ex) {
$msg = $ex->errorInfo;
error_log(var_export($msg, true));
die("<p>Sorry, there was a unrecoverable database error. Debug data has been logged.</p>");
}
}
catch (PDOException $ex) {
$msg = $ex->errorInfo;
error_log(var_export($msg, true));
die("<p>Sorry, there was a unrecoverable database error. Debug data has been logged.</p>");
};
?>
Bookmarks