* Sunda Cyber Army 2k17 *
Indonesia Defacer ~
<?php
$host = "webdev.iyaserver.com";
$userid = "[youruserid]";
$userpw = "[yourpw]";
$db = "[database name]";
include '../pdloginvariables.php';
$mysql = new mysqli(
$host,
$userid,
$userpw,
$db
);
// because there may be special characters in the database data (there are), make sure to set a charset
$mysql->set_charset("utf8");
if($mysql->connect_errno) {
echo "db connection error : " . $mysql->connect_error;
exit();
}
//default sql query with limit of 50 records
if(empty($sql)) {
$sql = "SELECT * FROM movieView where rating='PG' ORDER BY title LIMIT 50";
}
$results = $mysql->query($sql);
if(!$results) {
echo "SQL error: ". $mysql->error;
exit();
}
$json_array = array();
while($currentrow = $results->fetch_assoc()) {
$json_array[] = $currentrow;
}
/*
echo "<pre>";
print_r($json_array);
echo "</pre>";
*/
// $json2 = json_encode(mb_convert_encoding($json_array['name'], 'UTF-8', 'UTF-8'));
// create new $json object that has full php array data, but encoded as json
$json2 = json_encode($json_array, JSON_UNESCAPED_UNICODE);
// echo "json error: " . json_last_error_msg() . "<hr>";
//echo $json2;
// echo "<script>console.log($json2)</script>";
?>