I'm trying to build up a long string of variables, but my code only outputs the last entry in the MySQL database, can anyone point out my mistake?
$query = "SELECT * FROM `Litem` WHERE 1";
$result = $db->query($query); $i=1;
$i=1;
while ($row = $result->fetch_assoc()) {
if($i=1){$itemlist = "'".$row[Part_Name];}
else{$itemlist .= "','".$row[Part_Name]; }
$i++;
}
$itemlist .= "'";
echo $itemlist;