Hoi,
Ik heb een vraagje.
Ik heb een script, met 3 variabelen. Elke variabele heeft een uitkomst van 1 getal. Deze 3 variabelen moeten in 1 variabele, zodat als ik deze oproep de getallen achter elkaar komen...maar wel gescheiden. Ik heb nu het volgende:
<?php
setlocale(LC_TIME, 'NL_nl');
ob_start();
error_reporting(0);
// connection
$db_conx = mysqli_connect("localhost", "root", "", "nood_oproep");
// Evaluate the connection
if (mysqli_connect_errno()) {
echo mysqli_connect_error("Our database server is down at the moment. :(");
exit();
}
$ambulances ='';
$polities = '';
$brandweers = '';
//Get lists from db
$sql = mysqli_query($db_conx, "SELECT * FROM Voertuigen_zeeland");
while($row = mysqli_fetch_array($sql)){
$ambulance = $row['Ambulance'];
$politie = $row['Politie'];
$brandweer = $row['Brandweer'];
$ambulances = $ambulances.'"'.$ambulance.'",';
$polities = $polities.$politie.',';
$brandweers = $brandweers.$brandweer.',';
}
$ambulances = trim($ambulances, ",");
$polities = trim($polities, ",");
$brandweers = trim($brandweers, ",");
$totaal = $ambulance. $politie. $brandweer;
echo $totaal;
?>
Nu zet hij dus deze getallen achter elkaar, maar ze moeten netjes gescheiden zijn. Hoe krijg ik dit voor elkaar? Help!
2.257 views