maby this is a simple problem, but i´m not able to solve this.
meantime i can load data from mysql, rank them, write into database, …
the only thing i miss and i cannot manage is - calling a simple row and write the value into
a innerHTML of an element in hype.
i have a php - code, which works perfectly alone:
<?php
include ('DB3.php');
$con = mysqli_connect($host,$user,$pass,$databaseName);
if (!$con) {
die('Could not connect: ' . mysqli_error($con));
}
// Change character set to utf8
mysqli_set_charset($con,"utf8");
mysqli_select_db($con,$tableName);
$sql="SELECT * FROM $tableName WHERE id = 17";
$result = mysqli_query($con,$sql);
while($row = mysqli_fetch_array($result)) {
echo "<td>" . $row['zeit'] . "</td>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['password'] . "</td>";
}
mysqli_close($con);
?>
ok, so far and my hype-call is:
var txt1 = hypeDocument.getElementById("nr").innerHTML;
var txt2 = hypeDocument.getElementById("header").innerHTML;
var txt3 = hypeDocument.getElementById("sub").innerHTML;
$.ajax({
url: "get2.php",
type: "POST",
dataType: 'HTML',
data: { username: txt1,
password: txt2,
zeit: txt3
},
success: function(data){
$('#result').html("SUPER");
hypeDocument.startTimelineNamed('success', hypeDocument.kDirectionForward);
}
});
how do i post the database values into the hype-textfields (txt1,txt2,txt3)??
maby anyone has a lot of experience with it. thank you.