MySQL query vraag.

Gestart doorMarvinn14 reacties26 weergaven

15 berichten · pagina 1 van 1

Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hey.

Klein vraagje. Ik heb dit:

f(mysql_num_rows($sql_ip) != 0) {
            echo "Dit account is helaas verbannen, Omdat de gebruiker de regels heeft overtreden. Soort ban: IP<br />";
        }
        if(mysql_num_rows($sql_member) != 0) {
        echo "Dit account is helaas verbannen, Omdat de gebruiker de regels heeft overtreden. Soort ban: Account ban<br />";
        }else{


Alleen nu krijg ik:

Dit account is helaas verbannen, Omdat de gebruiker de regels heeft overtreden. Soort ban: IP
Dit account is helaas verbannen, Omdat de gebruiker de regels heeft overtreden. Soort ban: Account ban

2 keer dus, hoe los ik op dat het in 1 regel is? dus:
Dit account is helaas verbannen, Omdat de gebruiker de regels heeft overtreden. Soort ban: IPban/Account ban
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Dit account is helaas verbannen, omdat de gebruiker de regels heeft overtreden. Soort ban: "[/COLOR][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_ip[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"IPban<br />"[/COLOR][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_member[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"/Account ban<br />"[/COLOR][COLOR= #007700];
        }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Als iemand nu leden systeem ban heeft staat er:

IPban
/Account ban

Leden systeem ban is: $sql_member
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Dit account is helaas verbannen, omdat de gebruiker de regels heeft overtreden. Soort ban: "[/COLOR][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_ip[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"IPban/"[/COLOR][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_member[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Account ban<br />"[/COLOR][COLOR= #007700];
        }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nog steeds: IPban/Account ban

Als iemand ip ban heeft staat er: IPban/Account ban
Als iemand account ban heeft staat er: IPban/Account ban
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maar het moest toch in 1 regel? confused
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nee, yummie
Als iemand IP ban heeft moet er staan: Deze gebruiker blabla Soort ban: IP BAN
Als iemand account ban heeft moet er staan: Deze gebruiker blabla Soort ban: Account ban
Als iemand account ban+ip ban heeft moet er staan: Deze gebruiker blabla Soort ban: IP BAN+Account ban

toevoeging op 20 maart 2012, 171856:
Niemand een idee?
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nickjexx schreef:
Nee, yummie
Als iemand IP ban heeft moet er staan: Deze gebruiker blabla Soort ban: IP BAN
Als iemand account ban heeft moet er staan: Deze gebruiker blabla Soort ban: Account ban
Als iemand account ban+ip ban heeft moet er staan: Deze gebruiker blabla Soort ban: IP BAN+Account ban
toevoeging op 20 maart 2012, 171856:
Niemand een idee?

Elseif en mysql. Geef me FTP of TV en ik fix oor je winkSpreek me morgen aan @ skype.
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heeft iemand anders dan nog een oplossing? Zodat het vandaag nog opgelost kan worden yummie?
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php

$before_ban[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Dit account is helaas verbannen, omdat de gebruiker de regels heeft overtreden. Soort ban: "[/COLOR][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_ip[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR] [COLOR= #007700]&&[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql_member[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]){[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$before_ban[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"IP Ban"[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql_ip[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR] [COLOR= #007700]&&[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql_member[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]){[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$before_ban[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"Account ban"[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql_ip[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR] [COLOR= #007700]&&[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql_member[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]){[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$before_ban[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"IP Ban + Account ban"[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]

?>
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php

$ipban[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql_ip[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$userban[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql_member[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ipban[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]0[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$userban[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR] 
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Dit account is helaas verbannen, omdat de gebruiker de regels heeft overtreden. Soort ban: [/COLOR] [COLOR= #007700].
         ( ([/COLOR][COLOR= #0000BB]$ipban[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) ? ( ([/COLOR][COLOR= #0000BB]$userban[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) ?[/COLOR] [COLOR= #DD0000]IP ban &amp; Account ban[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]IP ban[/COLOR] [COLOR= #007700]) :[/COLOR] [COLOR= #DD0000]Account ban[/COLOR][COLOR= #007700]);
}[/COLOR]

?>
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rik schreef:
[COLOR= #0000BB]<?php

$ipban[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql_ip[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$userban[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql_member[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ipban[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]0[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$userban[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR] 
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Dit account is helaas verbannen, omdat de gebruiker de regels heeft overtreden. Soort ban: [/COLOR] [COLOR= #007700].
         ( ([/COLOR][COLOR= #0000BB]$ipban[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) ? ( ([/COLOR][COLOR= #0000BB]$userban[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) ?[/COLOR] [COLOR= #DD0000]IP ban &amp; Account ban[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]IP ban[/COLOR] [COLOR= #007700]) :[/COLOR] [COLOR= #DD0000]Account ban[/COLOR][COLOR= #007700]);
}[/COLOR]

?>
Tnx Rik biggrin
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Dat boven mijn post hoort overigens ook te werken, maar is (mijns inziens) minder net.
Mijne is ook niet echt netjes, maar is gewoon short-code.
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rik schreef:
Dat boven mijn post hoort overigens ook te werken, maar is (mijns inziens) minder net.
Mijne is ook niet echt netjes, maar is gewoon short-code.
Voluit vind ik altijd duidelijker, maarja, opgelost nu thumbsup
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Vriendje schreef:
Eerdere citaten tonen
Rik schreef:
Dat boven mijn post hoort overigens ook te werken, maar is (mijns inziens) minder net.
Mijne is ook niet echt netjes, maar is gewoon short-code.

Voluit vind ik altijd duidelijker, maarja, opgelost nu thumbsup
Voluit is ook duidelijker, maar telkens mysql_num_rows doen, terwijl je het ook in een var kan stoppen is sowieso een goed idee.
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