Having some troubles with this loop.
Any ideas on how I could ensure every row from the DB was outputted?
Do I need a while loop instead?
Code: Select all
//SQL Extract
$query = mysql_query("SELECT *, aupapercategory.paperCategory FROM ausapapersummary
LEFT JOIN aupapercategory ON ausapapersummary.paperCategoryId = aupapercategory.papercategoryId
LEFT JOIN austock ON ausapapersummary.stockId = austock.StockId
LEFT JOIN auadhesive ON ausapapersummary.adhesiveId = auadhesive.adhesiveId
LEFT JOIN auliner ON ausapapersummary.linerId = auliner.linerId
LEFT JOIN ausupplier ON ausapapersummary.supplierId = ausupplier.supplierId
LEFT JOIN ausuitability ON ausapapersummary.suitabilityFoil = ausuitability.suitabilityId
LEFT JOIN admins ON ausapapersummary.ausapaperUserId = admins.id WHERE 1=1");
// For loop
$csvOutput = array("$colloPaperName", "$paperCategory", "$manufacturerName", "$supplier", "$availability", "$features", "$limitations", "$productExamples", "$suitabilityFoil", "$suitabilityYellowLight", "$suitabilityLabel", "$suitabilityOpacity", "$suitabilityBronze", "$suitabilityScreen", "$suitabilityIceBucket", "$stockDescription", "$basisWeight", "$caliper", "$wetTensileStrenghtCD", "$wetTensileStrenghtMD", "$dryTensileStrengthCD", "$dryTensileStrengthMD", "$opacity", "$gloss", "$moistureContent", "$brightness", "$relativeHumitity", "$absorbtion", "$smoothness", "$tearStrengthCD", "$tearStrengthMD", "$burstStrength", "$pH", "$adhesiveDescription", "$thickness", "$initialTack", "$ballTack", "$peelAdhesion180", "$peelAdhesion90", "$shear", "$shelfLife", "$minApplicationTemp", "$serviceMin", "$serviceMax", "$linerDescription", "$grammage", "$caliper", "$strengthCD", "$strengthMD", "$translucency", "$shear", "$humidity", "$smoothnessWS", "$smoothnessFS", "$releaseForceLow", "$releaseForceHigh");
for($x = 0; $x<count($csvOutput); $x++) {
echo $csvOutput[$x];echo",";
}