I have this problem, my actual code looks like this
<div class="content">
<div class="main">
<h4 class="text-center">VOTA!</h4>
<!-- empieza star encuesta -->
<input value="<?= getRatingByProductId(connect(), 1); ?>"
type="number" class="rating" min=0 max=5 step=0.1 data-size="md"
data-stars="5" productId=1>
<b><label id="ejecutivo" style="color:#1658a2"></label></b>
But wen I put the code on my AWS server the code only show like this, don't show the function and shows baadly. Even worst the code does not show entirely. just stop here.
<div class="content">
<div class="main">
<h4 class="text-center">VOTA!</h4>
<!-- empieza star encuesta -->
<input value="
I know it's something wrong on php on this server, but I repeat only happens on the AWS server, on the local server works perfectly.
The PHP code is:
$mysqli = new mysqli($hostname, $username, $password, $dbname);
return $mysqli;
}
function getRatingByProductId($con, $productId)
{
$resultado = $con->query("SELECT SUM(vote) as vote, COUNT(vote) as count
from rating2 WHERE product_id = $productId and nombre='" . $ipaddress . "'");
$resultSet = $resultado->fetch_assoc();
if($resultSet['count']>0) {
return ($resultSet['vote']/$resultSet['count']);
} else {
return 0;
}
First of all, this is not a Javascript function issue, as the function is PHP-based only. As @reporter states in comments, it looks like something in the echo tag construct is causing an error. I'd suggest:
mysqli
extension is loaded on the AWS instance
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.