<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m,sap.ui.table,sap.ui.commons"
data-sap-ui-theme="sap_bluecrystal">
</script>
<!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->
<script>
var json = new sap.ui.model.json.JSONModel();
$.ajax({
url: 'tableData.php',
async:false,
success: function(data) //on recieve of reply
{
json.setData(JSON.parse(data));
},
error: function(err)
{
console.log(err);
}
});
var tableo = new sap.ui.table.Table({
title : "Arjun's First Table",
visibleRowCount : 5
});
tableo.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({text:"Userid"}),
template : new sap.ui.commons.TextField().bindProperty("value","Userid"),
width : "140px"
}));
tableo.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({text:"Name"}),
template : new sap.ui.commons.TextField().bindProperty("value","Name"),
width : "140px"
}));
tableo.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({text:"Age"}),
template : new sap.ui.commons.TextField().bindProperty("value","Age"),
width : "140px"
}));
tableo.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({text:"Email"}),
template : new sap.ui.commons.TextField().bindProperty("value","Email"),
width : "140px"
}));
tableo.setModel(json)
tableo.bindRows("/result");
tableo.placeAt("content");
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "employee";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "select * from user";
$res = mysqli_query($conn,$sql);
$result = array();
while($row = mysqli_fetch_array($res)){
array_push($result,
array('Userid'=>$row[0],'Name'=>$row[1],'Age'=>$row[2],'Email'=>$row[3]));
}
echo json_encode(array('result'=>$result));
?>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
11 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |