I'm trying to run a simple MySQl procedure in XML format then call it through PHP. This is my SQL procedure:
Select *
from sessionlogs
order by sessionID desc, eventID asc
LIMIT 10;
This is my PHP code:
<?php
// Create connection
$conn = new mysqli('localhost', 'root', 'secret', 'edgeserver');
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Perform queries
$result = mysqli_query($conn,
"call new_session") or die("Query fail: " . mysqli_error($conn));
//loop the result set
while ($row = mysqli_fetch_array($result)){
echo $row[0] . " " . + $row[1];
}
$conn->close();
?>
Cant seem to get it into XML format. Please Help.