$con=mysqli_connect("localhost","stalcouman_site","danny123","stalcouman_site");
$result = mysqli_query($con,"SELECT * FROM news ORDER BY time DESC");
$current_page = 1;
if(isset($_GET["page"]))
$current_page = $_GET["page"];
$counter = 1;
$news1_row;
$news2_row;
while($row = mysqli_fetch_array($result))
{
$multiplied =$current_page*2 ;
if($counter == $multiplied-1)
{
$news1_row = $row;
}
else if($counter == $multiplied)
{
$news2_row = $row;
}
$counter ++;
}
$pages = $counter / 2;
if(isset($_GET["item"]))
{
$result2 = mysqli_query($con,"SELECT * FROM news where id=".$_GET["item"]);
while($row2 = mysqli_fetch_array($result2))
{
$news_item = $row2;
}
}
?>
Stalcoumans.nl, Welkom bij Stal Coumans uw rustpunt voor ontspanning en training van uw paard of pony
|
|
|
|
if(!isset($news_item))
{
?>
echo $news1_row["titel"]; ?> - echo date("d-m-Y",$news1_row["time"]); ?>
"/>
if(isset($news2_row)){ ?>
echo $news2_row["titel"]; ?> - echo date("d-m-Y",$news2_row["time"]); ?>
"/>
}?>
for ($x=0; $x < $pages+1; $x++)
{
if($x != 0)
{
echo "| $x |";
}
}
?>
}
else
{
//Individueel nieuws item tonen.
?>
echo $news_item["titel"]; ?> - echo date("d-m-Y",$news_item["time"]); ?>
echo $news_item["text"]; ?>
}
?>
|
|
|
|
|
|