Kleine Vragen Topic #1

Gestart doorLennard4.284 reacties15.585 weergaven

4.285 berichten · pagina 101 van 286

Berichten
16.500
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
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?
0
Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jellerth schreef:
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?
float:right en z-index?
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Hoe selecteer ik de laatste 3 nieuwsberichten met SQL? Op google vind ik allemaal te moeilijke dingenbloos
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
LIMIT 3
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ORDER BY id DESC LIMIT 3
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
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]
                ?>


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
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Dylanh schreef:
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]
                ?>
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


Een white loop: http://php.net/manual/en/control-structures.while.php

Zit op me iPad, helaas ff geen voorbeeld
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Ik wacht op een voorbeeld xD en ondertussen probeer ik wat met while();
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
while(); ???

while() {

}

$sql = mysql_query("SELECT laatste 3");
while($row = mysql_fetch_assoc($sql)) {
echo $row[titel];
}
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
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..
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dylanh schreef:
Eerdere citaten tonen
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..
Met jouw script hier zou er dit moeten komen

titel1
titel1
titel1
titel2
titel2
titel2
titel3
titel3
titel3

toevoeging op 14 september 2012, 201608:
Of je hebt nog maar 1 bericht =_=
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Ik denk dat.laaste ja want daar staat NULL
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Nee. Je kan wel de .html rewriten naar .php, zodat je dus .html ziet maar in werkelijkheid PHP wordt uitgevoerd.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Lennard schreef:
Nee. Je kan wel de .html rewriten naar .php, zodat je dus .html ziet maar in werkelijkheid PHP wordt uitgevoerd.
Zoals ik doe bij iedere pagina op mij site emo
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren