<?php
include 'connection.php';
//showing some data and how this will work
$sql = $dbh->prepare("select * from rec_recipes");
$sql->execute();
while ($row = $sql->fetch()){
	$id = $row[0];
	$title = $row[1];
	$recipe = $row[2];

	$sentencearray = explode(".",$recipe);
	for ($i=0;$i<3;$i++){
		$recipeshort .= $sentencearray[$i].'. ';
	}

	$recipeshort .= ' <a href="recipe.php?recipeid='.$id.'">Read More</a>';

	echo '<h3>'.$title.'</h3>';
	echo '<img src ="images/'.$id.'.jpg" alt="'.$title.'" height="100"/><br>'; 
	echo $recipeshort.'<br><br><br>';
	unset($recipeshort);
}

?>