Created
March 10, 2015 15:01
-
-
Save amin007/5dc835496fb57d121184 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// tukar jadi data json dari main website | |
############################################## | |
include "db_buka.php";// buka pangkalan data # | |
############################################## | |
$mysqli = new mysqli($myServer, $myUser, $myPass, $myDB); | |
$myArray = array(); | |
if ($result = $mysqli->query('SELECT `id`, `bahagian`, `nama`, `link`, `target` FROM link')) | |
{ | |
while($row = $result->fetch_array(MYSQL_ASSOC)) | |
{ | |
$myArray[] = $row; | |
} | |
echo json_encode($myArray); | |
} | |
$result->close(); | |
$mysqli->close(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment