<?php
	require_once('../system/Physis.php');

	require_once('../system/Database.php');

	$database =& DatabaseConnect::getInstance();

	$database->query("SET CHARACTER SET utf8");

	$search = $_POST["search"];
	
	
				if($database->query("SELECT DISTINCT id, title, author FROM sosa_main WHERE ((title like '%$search%') or (content  like '%$search%') or (ingr like '%$search%'))")):
				
				$id = $database->loadResultArray(0);
							$title = $database->loadResultArray(1);
							$content = $database->loadResultArray(2);
							
	
					
					header('location:../recepti/index.php?search='.$search);
					

						
				else:

					header('location:../recepti/error.php&message='.mysql_error());

				endif;

?>