{source}
<!– You can place html anywhere within the source tags –>
<script language=”javascript” type=”text/javascript”>
// You can place JavaScript like this
</script>
<?php
// You can place PHP like this
$db = “astrolog_3”; //set this to the name of your database
$host = “localhost”; //set this to the name of your host
$user = “astrolog_3“; //set this to your db user name
$pass = “123123123”; //set this to your db password
$db = mysql_connect(“$host”,”$user”,”$pass”,”$db”);
$connect = mysql_connect(“$host”, “$user”, “$pass”); //make db connection
mysql_connect($host, $user, $pass);
//mysql_select_db($db);
mysql_query(‘set character set greek’,$connect);
mysql_query(“SET NAMES ‘utf8′”,$connect);
mysql_select_db(“astrolog_3”) or die(mysql_error());
$categories_name = $_GET[‘categories_name’];
//$_POST[‘categories_name’] = ‘Α’;
$categories_name = urldecode($categories_name);
$categories_name = mysql_real_escape_string($_GET[‘categories_name’]);
if (isset($_GET[“page”])) { $page = $_GET[“page”]; } else { $page=1; };
$start_from = ($page-1) * 20;
//$query = “SELECT categories_name FROM astro_dreams WHERE categories_name='{$_POST[‘Α’]}’ ORDER by categories_name ASC LIMIT $start_from, 20”;;
$query = “SELECT * FROM astro_dreams WHERE categories_name LIKE ‘%{$_GET[‘categories_name’]}%’ ORDER by categories_name ASC LIMIT $start_from, 20”;;
mysql_query(“SET NAMES ‘utf8′”);
mysql_query(“SET CHARACTER SET ‘utf8′”);
$result = mysql_query($query);
if(!$result){die(“BAD!”);}
while($row = mysql_fetch_assoc($result))
{
echo
“<a href=’dreaminterpretation.html?searchStr=”.$row[‘categories_name’].”‘>{$row[‘categories_name’]}</a> <br>” . “
“;
}
$sql = “SELECT COUNT(categories_name) FROM astro_dreams”;
$rs_result = mysql_query($sql,$connect);
$row = mysql_fetch_row($rs_result);
$total_records = $row[0];
$total_pages = ceil($total_records / 20);
for ($i=1; $i<=$total_pages; $i++) {
echo “<a href=’alphab.html?page=”.$i.”‘>”.$i.”</a> “;
};
mysql_close($db);
?>
{/source}