Help!

Gestart doorMitchels35 reacties214 weergaven

36 berichten · pagina 1 van 3

Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Kun je van index.php lijn 1 t/m lijn 30 posten?

Dan zal ik even voor je kijken!
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Alvast Bedankt!pompom
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/**
 * @author orDian
 * @name Banner System
 * @version v0.3 Final
 * @copyright 2009
 */[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$ip[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]];[/COLOR]

[COLOR= #0000BB]$results[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM banners ORDER BY id ASC"[/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]$results[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/for"]for[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$x[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$x[/COLOR] [COLOR= #007700]<=[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]banner_weight[/COLOR][COLOR= #007700]];[/COLOR][COLOR= #0000BB]$x[/COLOR][COLOR= #007700]++)
{[/COLOR][COLOR= #0000BB]$prodlist[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];}
}[/COLOR]
[URL="http://www.php.net/srand"]srand[/URL] [COLOR= #007700]((double)[/COLOR] [URL="http://www.php.net/microtime"]microtime[/URL][COLOR= #007700]() *[/COLOR] [COLOR= #0000BB]1000000[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$numb[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$prodlist[/COLOR][COLOR= #007700])-[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$num[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$prodlist[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$numb[/COLOR][COLOR= #007700]];[/COLOR]

[COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM ids WHERE ip=$ip AND bid=$num AND corv=v"[/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]$result[/COLOR][COLOR= #007700]))
{[/COLOR]
    [COLOR= #0000BB]$id[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];
}[/COLOR]

[COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM banners WHERE id = $num"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$results[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM banners WHERE id = $num"[/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]$results[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700])){[/COLOR]
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Probeer dit eens:
$results = mysql_query ("SELECT * FROM banners ORDER BY id ASC");
veranderen in
$results = mysql_query ("SELECT * FROM banners ORDER BY `id` ASC");

en kijk dan of 1e error weggaat
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
NeesadleyRij 12 is dit: while ($row = mysql_fetch_array($results)){
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
heb net een kleine aanpassing gemaakt, werkt hij wel met deze:

$results = mysql_query ("SELECT * FROM banners ORDER BY `id` ASC");

En ik weet dat rij 12 dat is, maar de fout zit hem in een mysql-query die hij niet kan uitvoeren
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
while ($row = mysql_fetch_array($results))(

Probeer hierboven eens
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
No, wat jij bewerkt is rij 11 en je hebt rij 12 nodigwink
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Mitchels schreef:
No, wat jij bewerkt is rij 11 en je hebt rij 12 nodigwink
Rij 12 gebruikt de query uit rij 11, omdat de query uit rij 11 (waarchijnlijk) niet goed wordt uitgevoerd krijg je de error op rij 12 omdat daar pas een fout ontstaat wink
En dit zou goed moeten zijn: $results = mysql_query ("SELECT * FROM banners ORDER BY `id` ASC")

heb je wel goede tabelnamern enzo?
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ok
Nu krijg ik dit± Parse error: syntax error, unexpected T_WHILE in /home/mitchels/domains/kliklinks.nl/public_html/banner/index.php on line 12
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Xsukkelx:
while ($row = mysql_fetch_array($results))(

Probeer hierboven eens

Dat gaat zoiezo niet werken want dan krijg je een error omdat je ( in plaats van { gebruikt x]

@ hierboven: Post rij 12 nu nog eens?
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
while ($row = mysql_fetch_array($results))
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
moet { achter
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan nog steeds

Parse error: syntax error, unexpected T_WHILE in /home/mitchels/domains/kliklinks.nl/public_html/banner/index.php on line 12
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Pff, als je me vertrouwd kun je me ff heel index.php / SQL geven en dan ga ik er met mijn PHP-IDE overheen om fouten op te sporen, en dan kijk ik of ik hem op mijn sql draaiende krijg zodat hij ook bij jou moet werken :]

Zie dat de whilefout is opgelost, nu nog de sql.. xD
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