codice:$conn = new mysqli($servername, $username, $password, $dbname); $sql="SELECT tec_a.targa AS tg, tec_a.km_tot_contratto, tec_a.filiale, tec_a.stato, tec_p.data_inserimento, tec_a.mesi FROM tec_a INNER JOIN tec_p ON tec_a.targa = tec_p.targa GROUP BY tec_a.targa WHERE tec_a.filiale='rm' AND tec_a.stato = 'IN CARICO' AND tec_p.data_inserimento >= '2023-04-01' AND tec_p.data_inserimento <= '2023-04-15' "; $result = $conn->query($sql); //display data on web page if ($result->num_rows > 0) { while($row = mysqli_fetch_array($result)){ echo " ----- Targa : ". $row['tg'] , " ----- mesi : " . $row['mesi'], " ----- mesi : " . $row['data_inserimento']; echo "<br>"; } } else { if ($conn -> connect_errno) { echo "Failed to connect to MySQL: " . $conn -> connect_error; exit(); } }

Rispondi quotando