; tussen rows

Gestart doorAntonn7 reacties215 weergaven

8 berichten · pagina 1 van 1

Antonn

Lid · Topicstarter

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik wil gegevens uit een database halen met er een ; tussen. Ik wil iets als dit:

naam1;naam2;naam3;naam4


Maar ik krijg alleen naar dit.

naam1;naam2;naam3;naam4;


Kan iemand helpen?
0
Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je wilt gegevens uit de db halen, doe dn gewoon exporteren..
0
Berichten
5.795
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$aantal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$jequery[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/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]$jequery[/COLOR][COLOR= #007700])) {[/COLOR]
    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]!=[/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"veld"[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]";"[/COLOR][COLOR= #007700];
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"veld"[/COLOR][COLOR= #007700]];
    }[/COLOR]
    [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++;
}[/COLOR]
?>


zoiets zou je dan moeten hebben
0
Antonn

Lid · Topicstarter

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Daiman schreef:
[COLOR= #0000BB]<?php
$aantal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$jequery[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/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]$jequery[/COLOR][COLOR= #007700])) {[/COLOR]
    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]!=[/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"veld"[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]";"[/COLOR][COLOR= #007700];
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"veld"[/COLOR][COLOR= #007700]];
    }[/COLOR]
    [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++;
}[/COLOR]
?>
zoiets zou je dan moeten hebben

Thanks smile
0
Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oh je bedoelt het zo xd
0
Antonn

Lid · Topicstarter

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Daiman schreef:
[COLOR= #0000BB]<?php
$aantal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$jequery[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/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]$jequery[/COLOR][COLOR= #007700])) {[/COLOR]
    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]!=[/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"veld"[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]";"[/COLOR][COLOR= #007700];
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"veld"[/COLOR][COLOR= #007700]];
    }[/COLOR]
    [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++;
}[/COLOR]
?>
zoiets zou je dan moeten hebben

Werkt niet omdat de aantal telt vanaf 1 en de $i vanaf 0, even de aantal - 1 doe nen het werkt wel. Eens kijken of dit werkt smile
[COLOR= #0000BB]<?php
$aantall[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$jequery[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$aantal[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$aantall[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/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]$jequery[/COLOR][COLOR= #007700])) {[/COLOR]
    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]!=[/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"veld"[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]";"[/COLOR][COLOR= #007700];
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"veld"[/COLOR][COLOR= #007700]];
    }[/COLOR]
    [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++;
}[/COLOR]
?>
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je kunt ook gewoon beginnen met $i =1;
0
Antonn

Lid · Topicstarter

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gamedealer schreef:
Je kunt ook gewoon beginnen met $i =1;
Slim gezien, dom van me yummie
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