ok, you can still apply the code
list($name, $address, $city, $state, $zip, $socksize) = explode("|", $line);
but now $line must be a row that has been fetched from mysql.
$query = "SELECT * FROM table";
$result = mysql_query($query);
while($data = mysql_fetch_array($result)) {
$line = $data['info'];
list($name, $address, $city, $state, $zip, $socksize) = explode("|", $line);
//do some stuff
}
this assumes the data is in the mysql field called info which is probably not the case, but its just an example.