query($query); if (PEAR::isError($stmt)) { die($stmt->getMessage()); } $result = $stmt->fetchAll(); /* echo '
'; print_r($result); echo ''; */ //global variables $replacements = array("'" => ''', "£" => "£","€" => "€","á" =>"a","í" => "i","è" => "e","é" => "e","ü" => "u","ù"=> "u","ç" => "c","ñ" => "n", "ó" => "o", "¿" => "?","Á" => "A","É" => "E", "Í" => "I", "Ó" => "O","Ö" =>"O", "Ú" => "U", "Ñ" => "N", "Ü" => "U", "½" => ".5" ); $headerdescriptionadd = true; // display document in browser as plain text // for readability purposes foreach($result as $key => $row) { $storyId = $row['story_id']; $headline = strtr($row['headline'],$replacements); $smsLine = strtr($row['abstract'],$replacements); $detail = strtr($row['detail'],$replacements); $teamId = $row['team_id']; $storyType = $row['story_type']; $teamName = $row['teamname']; $fixtureId = $row['match_id']; $tstamp = $row['tstamp']; $imageId = $row['image_id']; /** Some processing on pics....***/ $filepath = ""; if ($imageId > 0) { $imagepath = $row['location']; //note the DB image path will be like C:\Feeds\Images\Match Reports\rs_20140211221445.jpg //need to convert to http://feeds.ics-sport.com/images/Match Reports/rs_20140211221445.jpg $filepath=str_replace('C:\\Feeds\\Images\\','http://feeds.ics-sport.com/images/',$imagepath); $filepath=str_replace('\\','/',$filepath); //$fullImageURL = $filepath; } // create root element if ($headerdescriptionadd) { echo ''; echo '