if(isset($_GET['cat_id'])) {
$qid = mysqli_query($db, "select max(cat_id) as maximum from project_cat where cat_cat = '2' ");
$max = mysqli_fetch_assoc($qid);
$max = $max['maximum'];
$qidtitel = mysqli_query($db, "select * from project_cat where cat_cat = '2' and cat_id = " . $max . ""); //cat_id, cat_genre, substring(cat_text,6,80) as tekst
$titel = mysqli_fetch_assoc($qidtitel);
?>
Nieuws: echo stripslashes($titel['cat_genre']); ?>
echo stripslashes($titel['cat_text']); ?>
} else {
$qid = mysqli_query($db, "select * from teksten where id_tekst='2'");
$news = mysqli_fetch_assoc($qid);
?>
echo $news['heading'] ; ?>
echo stripslashes($news['text_verhaal']); ?>
} ?>
$qidtitel = mysqli_query($db, "select * from project_cat where cat_cat = '2' order by cat_id desc limit 3"); //cat_id, cat_genre, substring(cat_text,6,80) as tekst
if(mysqli_num_rows($qidtitel) <> 0) {
?>
ONAFHANKELIJK NIEUWS
//$qidtitel = mysqli_query($db, "select * from project_cat where cat_cat = '2' order by cat_id desc limit 3"); //cat_id, cat_genre, substring(cat_text,6,80) as tekst
while ($titel = mysqli_fetch_assoc($qidtitel)){
?>
$string = $titel['cat_text'];
//$string = substr($titel['cat_text'],6,85);
//$string="
Een hele lange zin met lekker veel woorden, zodat je deze functie kunt testen.";
$string = str_replace("
", "", $string);
$string = str_replace("
", "", $string);
$aantalwoorden=10;
$de_tekst = join(array_slice(explode(" ", $string), 0, $aantalwoorden)," ");
?>
echo $titel['cat_genre'] ; ?>
echo $de_tekst; ?> ...
} ?>
}
if(mysqli_num_rows($qidtitel) == 0) {
?>
} ?>