On 7/29/09 1:34 PM, "Ashley Sheridan" <ash@xxxxxxxxxxxxxxxxxxxx> wrote: On Wed, 2009-07-29 at 11:29 -0700, Miller, Terion wrote: > I am trying to get rid of empty whitespace lines, I can't us chop() because > as I read it it will remove all whitespaces....right? > > Right now my db is outputting with extra lines, I have stripped tags I know > it isn't that causing it to look like this > > Blahlajdlkfjlksdjflkdjsf > > <--------------how do I get rid of all this extra space? > > alkdfjlsdakjflsakdjflksjdf > > Some example of where this is occurring in your code might help. HTML output will ignore whitespace such as this unless it is asked explicitly to preserve it, with a <pre> tag or CSS. Thanks Ash www.ashleysheridan.co.uk Well the html displays fine, its when I view the CSV in the db, I see the extra space, and I'm writing an application to reverse publish some of our site materials to the paper (I work for a newspaper) and the Quark output is picking up that extra space that is in the db (does that make sense?) Here is what the CSV looks like (See all that linespacing?) : ";"2009-01-20";"Inspection";"Will re-test dishwashing machine and sanitizer buckets for proper concentration, in addition to reviewing critical items, during time of re-inspection.";"5";" Employee drink found uncovered, sitting next to clean bin of eating utensils. This is a repeat violation. Sanitizer bucket holding wiping cloths was found at 0 ppm chlorine; must maintain concentration of solution at 50-100ppm chlorine to effectively sanitize food contact surfaces. Can opener blade found encrusted with dust and dried-on, black, food debris; must maintain clean food contact surfaces under frequent cleaning regiment, so as to not risk cross-contamination to food. Dishwashing machine found not effectively sanitizing as it measured 0 ppm chlorine; must maintain dishwasher so that it consistently and adequately sanitizes food contact surfaces. Corrected on site. This is a repeat violation. My code for the original insertion to the db is this(shortened up though) or ($i=0; $i < count($results[0]); $i++) { $name1 = strtolower($results[1][$i]); $name = ltrim($name1); $address = strtolower($results[2][$i]); $inDate = strtotime($results[3][$i]); $inType = strip_tags($results[4][$i]); $notes = strip_tags($results[5][$i]); $critical = strip_tags($results[6][$i]); $cviolations = strip_tags($results[7][$i]); $noncritical = $results[8][$i]; //trying to manipulate different field data $cleanViolations = str_replace('*', '', $cviolations); $ucName = ucwords($name); $ucAddress = ucwords($address); $formatDate = date('ymd', $inDate); //escaping strings good coder $mysql_name = mysql_escape_string($ucName); $mysql_address = mysql_escape_string($ucAddress); $mysql_inDate = mysql_escape_string($formatDate); $mysql_inType = mysql_escape_string($inType); $mysql_notes = mysql_escape_string($notes); $mysql_critical = mysql_escape_string($critical); $mysql_cviolations = mysql_escape_string($cleanViolations); $mysql_noncritical = mysql_escape_string($noncritical); //insert each to the database //attempt loop for checking restaurants // First check if the name exists $sql ="SELECT * FROM `restaurants` WHERE `name`='{$mysql_name}' AND `address` ='{$mysql_address}'"; $result = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($result) > 0){ $row = mysql_fetch_array($result); $ID = $row['ID']; // This means the name exists.. UPDATE inspections table $sql = "INSERT INTO `inspections` (ID, inDate, inType, notes, critical, cviolations, noncritical) VALUES ("; $sql .= "'$ID', '$mysql_inDate', '$mysql_inType', '$mysql_notes', '$mysql_critical', '$mysql_cviolations', '$mysql_noncritical')"; mysql_query($sql); } else{ // The name doesn't exists, add all the info $sql = "INSERT INTO `restaurants` (name, address) VALUES ("; $sql .= " '$mysql_name', '$mysql_address')"; mysql_query($sql); $ID = mysql_insert_id(); $sql = "INSERT INTO `inspections` (ID, inDate, inType, notes, critical, cviolations, noncritical) VALUES ("; $sql .= " '$ID', '$mysql_inDate', '$mysql_inType', '$mysql_notes', '$mysql_critical', '$mysql_cviolations', '$mysql_noncritical')"; mysql_query($sql); } /**/ }; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php