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 ''; $headerdescriptionadd = false; } echo''; echo''; echo'Rivals Publishing'; echo'0'; echo''; echo $teamName; echo''; echo''; echo $teamId; echo''; echo''; echo'0'; echo'0'; echo'en-us'; echo''; echo''; echo'
'; echo''; echo'Rivals Publishing'; echo'Rivals Publishing'; echo'Rivals Publishing'; echo''; echo'
'; echo''; echo $storyId; echo''; echo''; echo $headline; echo''; echo''; echo $fixtureId; echo''; echo''; echo $tstamp; echo''; echo'
'; echo''; echo''; echo $headline; echo''; echo''; echo $smsLine; echo''; echo''; echo''; echo''; echo''; echo $detail; echo''; echo''; echo'
'; echo'
'; echo'
'; } echo'
'; } else { echo 'You do not have access to this feed from the following IP address: ' . $users_IP_address . ''; echo '
'; echo 'Please contact your provider...'; } ?>