Ik ben nu bezig met mijn banner helemaal rechts te plaatsen, wat ik nu krijg is dat hij wel rechts komt maar dan onder de tekst van het midden. Hoe los ik dit op?
Kleine Vragen Topic #1
Jellerth schreef:float:right en z-index?Ik ben nu bezig met mijn banner helemaal rechts te plaatsen, wat ik nu krijg is dat hij wel rechts komt maar dan onder de tekst van het midden. Hoe los ik dit op?
Hoe selecteer ik de laatste 3 nieuwsberichten met SQL? Op google vind ik allemaal te moeilijke dingen

LIMIT 3
ORDER BY id DESC LIMIT 3
Hmm, hoe moet ik nou de 3 nieuwste nieuws berichten ophalen:
ik heb dit:
alleen dit werkt niet ik wil zoiets:
ik heb dit:
[COLOR= #0000BB]<?php
$q[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT id FROM news ORDER BY id DESC LIMIT 3"[/COLOR][COLOR= #007700]));[/COLOR]
[COLOR= #0000BB]$news[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM news WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$q[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700]));[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$news[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]];[/COLOR]
?> alleen dit werkt niet ik wil zoiets:
echo $news[title] // nieuws titel van de aller nieuwste
echo $news[title] // nieuws titel van de 2e nieuwste
echo $news[title] // nieuws titel van de 3e nieuwste Dylanh schreef:alleen dit werkt niet ik wil zoiets:Hmm, hoe moet ik nou de 3 nieuwste nieuws berichten ophalen:
ik heb dit:[COLOR= #0000BB]<?php $q[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT id FROM news ORDER BY id DESC LIMIT 3"[/COLOR][COLOR= #007700]));[/COLOR] [COLOR= #0000BB]$news[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM news WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$q[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700]));[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$news[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]];[/COLOR] ?>
echo $news[title] // nieuws titel van de aller nieuwste
echo $news[title] // nieuws titel van de 2e nieuwste
echo $news[title] // nieuws titel van de 3e nieuwste Een white loop: http://php.net/manual/en/control-structures.while.php
Ik wacht op een voorbeeld xD en ondertussen probeer ik wat met while();
while(); ???
while() {
}
$sql = mysql_query("SELECT laatste 3");
while($row = mysql_fetch_assoc($sql)) {
echo $row[titel];
}
while() {
}
$sql = mysql_query("SELECT laatste 3");
while($row = mysql_fetch_assoc($sql)) {
echo $row[titel];
}
Antonn schreef:while(); ???
while() {
}
$sql = mysql_query("SELECT laatste 3");
while($row = mysql_fetch_assoc($sql)) {
echo $row[titel];
}
[COLOR= #0000BB]<?php
$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM news ORDER BY id DESC LIMIT 3"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]];
}[/COLOR]
?> nu krijg ik alleen de eerste..
Dylanh schreef:Met jouw script hier zou er dit moeten komenwhile() {Eerdere citaten tonen
Antonn schreef:while(); ???
}
$sql = mysql_query("SELECT laatste 3");
while($row = mysql_fetch_assoc($sql)) {
echo $row[titel];
}[COLOR= #0000BB]<?php $sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM news ORDER BY id DESC LIMIT 3"[/COLOR][COLOR= #007700]);[/COLOR] [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]];[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]];[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]]; }[/COLOR] ?>
nu krijg ik alleen de eerste..
titel1
titel1
titel1
titel2
titel2
titel2
titel3
titel3
titel3
toevoeging op 14 september 2012, 20
08:Of je hebt nog maar 1 bericht =_=
Ik denk dat.laaste ja want daar staat NULL
Kan je ook een html pagina hebben met ?p= ofzoiets.
Dus www.mijnsite.nl/koop.html?p=coldplay-vivalavida
Dus www.mijnsite.nl/koop.html?p=coldplay-vivalavida
Nee. Je kan wel de .html rewriten naar .php, zodat je dus .html ziet maar in werkelijkheid PHP wordt uitgevoerd.
Lennard schreef:Zoals ik doe bij iedere pagina op mij siteNee. Je kan wel de .html rewriten naar .php, zodat je dus .html ziet maar in werkelijkheid PHP wordt uitgevoerd.
