i´m able to write i.e. time and name into a database and call the whole table using ajax into hype again.
something like a highscore.
what i cannot manage is to call a specific $row[‘zeit’] and show in hype. it always shows me the whole table.
also i want to sort this row ascending. in php i tried natsort(), but failed, because i´ve to use a array of numbers.
maby someone can give me a hint how to do this?
thank you.
my php:
<?php
include ('DB.php');
$con = mysqli_connect($host,$user,$pass,$databaseName);
if (!$con) {
die('Could not connect: ' . mysqli_error($con));
}
mysqli_select_db($con,$tableName);
$sql="SELECT * FROM $tableName ORDER BY zeit";
$result = mysqli_query($con,$sql);
echo "<table>
<tr>
<th>Zeit</th>
<th>Name</th>
<th>Diverses</th>
</tr>";
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['zeit'] . "</td>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['password'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
my hype-function():
$.ajax({
url: 'dataBase.php',
type: 'POST',
dataType: 'HTML',
data: {
zeit: $('#zeit').val(),
},
success: function(response){
$("#load").html(response);
}
});