MYSQL/PHP fout?

Gestart doorMarvinn25 reacties30 weergaven

26 berichten · pagina 2 van 2

Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
an weet ik het ook niet ;-(

EDIT

Staat er wel wat in database?

EDIT2

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
#badgewrapper {
    float:left;
    width:53px;
    height:70px;
}

#badgeimg {
    width:45px;
    height:45px;
    text-align:center;
}

#totalwrapper {
    padding-left:33px;
}

#badgecode {
    width:45px;
    height:25px;
    text-align:center;
}
html, body{

    font-family: verdana;
    font-size: 10;
}

</style>
              
            <div id="totalwrapper" >       
              [COLOR= #0000BB]<?php

$mysql_host[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// dit is meestal localhost[/COLOR]
[COLOR= #0000BB]$mysql_user[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"."[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// voer hier je username van mysql in[/COLOR]
[COLOR= #0000BB]$mysql_password[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"."[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// voer hier je mysql wachtwoord in[/COLOR]
[COLOR= #0000BB]$mysql_database[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"."[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// hier vul je de naam van je database in[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mysql_host[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$mysql_user[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$mysql_password[/COLOR][COLOR= #007700]) ==[/COLOR] false [COLOR= #007700]&&[/COLOR] [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mysql_database[/COLOR][COLOR= #007700]) ==[/COLOR] false[COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Oeps, kon geen verbinding maken met de database, Controleer de gegevens!"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]();
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mysql_host[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$mysql_user[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$mysql_password[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mysql_database[/COLOR][COLOR= #007700]);
}[/COLOR]

                                    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM habbo_badges ORDER BY id DESC LIMIT 100"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
 [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]) <[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) {[/COLOR]

    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Geen badges"[/COLOR][COLOR= #007700];

    }[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
            
                    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]) >=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) {[/COLOR]
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]""[/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_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR]
                            [COLOR= #0000BB]$sql_badge[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM habbo_badges WHERE id="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
                            [COLOR= #0000BB]$row_badge[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql_badge[/COLOR][COLOR= #007700]);[/COLOR]
                            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<div id="badgewrapper"><div id="badgeimg"><img border="0" src=http://images.habbo.com/c_images/album1584/"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row_badge[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]".gif /></div><div id="badgecode">"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row_badge[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</div></div> "[/COLOR][COLOR= #007700];
                        }
                    }
}[/COLOR]
                    ?></div>
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja alleen http://www.habbotjes.be/badge/badge1.php

Is voor de laatste badge overzicht want als je bij http://www.habbotjes.be/badge

Gaat kijken zie je ze 1x en zijn ze weg. Misschien kun je dat oplossen?

EDIT: In de code van /badge
Staat dit:

$bes = mysql_query("SELECT * FROM habbo_badges WHERE naam = ".$z."");
if(mysql_num_rows($bes) == 0) {
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kijk edit
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hihi nu weer een andere fout: Unknown column id in order clause
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Licht echt aan id, hij zegt dat de in de database id niet gevonden kan worden.
Verander sql weer terug naar $sql = mysql_query("SELECT * FROM habbo_badges ORDER BY id DESC LIMIT 100");
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoe los je dat op?
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gewoon id toevoegen aan db tabel?
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoe yummie Ja ik snap veel van php maar niet van mysql yummie
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heb je teamviewer shutup
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja yummie
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Stuur je gegevens even via PM
Opgelost hij had id niet er instaan wink
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