我想知道是否可以在没有太多参数和字符串的情况下执行以下脚本...我认为可以删除很多内容...也许只有一个查询?
谢谢!
<?php
include("sqlvar.php");
$connection = new mysqli($host, $user, $pw, $db);
$marginidb = $connection->query("SELECT valore FROM DATIVENDITA WHERE parametro = 'margine'");
while($margine = $marginidb->fetch_object()) {
$valoremargine = $margine->valore;
}
$connection->close();
echo $valoremargine;
$connection = new mysqli($host, $user, $pw, $db);
$ivadb = $connection->query("SELECT valore FROM DATIVENDITA WHERE parametro = 'iva'");
while($iva = $ivadb->fetch_object()) {
$valoreiva = $iva->valore;
}
$connection->close();
echo $valoreiva;
?>