Nieuwe regel = Nieuwe query.

Gestart doorWouterr5 reacties33 weergaven

6 berichten · pagina 1 van 1

Wouterr

Lid · Topicstarter

Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Hey,

Ik heb geen flouw benul hoe ik dit moet gaan aanpakken..
maar hoe kan ik zorgen, dat in een textbox een nieuwe regel, een nieuwe query is?
Dus als je 10 regels hebt, dat dan elke regel een eigen query heeft?
ik moet namelijk helegrote dingne in me mysql database gaan proppen, en daar ben ik met de hand 10000 jaar mee bezig sadley(Lwc protecties, van NLMinecraft, alle chests, deuren enz... ~44321829 dingen.)

Alvast bedankt
Wouter aka Wouter0100 aka Snabbotube aka Bronmetkennis biggrin
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Exploden op enters:
Je hebt een textarea van een input, die heeft enters erin staan op n, daar kan je op exploden:

[COLOR= #0000BB]<?php[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]])){[/COLOR]
    [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]n[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]]);[/COLOR]
    [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$query[/COLOR][COLOR= #007700]){[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);
   }
}[/COLOR]
?>
0
Wouterr

Lid · Topicstarter

Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700][[/COLOR]conection weggelaten[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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])) &&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])){[/COLOR]
    [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]n[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$id[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
    [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$query[/COLOR][COLOR= #007700]){[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO prpermissions (permstring, entryid) VALUES ($query,$id)"[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$query[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] Succes.<br />[/COLOR][COLOR= #007700];
   }
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
<form action="wouterrr.php" method="post">
Permissions:<br/>
<textarea name="text">
</textarea><br/>
Group ID:<br/>
<input type="text" name="id" /><br/>
<input type="submit" name="submit"/><br/>
</form>
[/COLOR][COLOR= #007700];
}[/COLOR]

?>


Werkt nog steeds niet nu komt er dit:

Quote:
help version servertime accept players essentials.sethome essentials.home essentials.list essentials.help essentials.msg essentials.afk essentials.spawn iConomyChestShop.shop.create iConomyChestShop.shop.buy iConomyChestShop.shop.sell iConomyChestShop.command.iteminfo essentials.pay essentials.signs.heal.use lwc.protect chaircraft.sit towny.town.claim towny.spawntp essentials.geoip.show uQuest.CanQuest.* citizens.use.* towny.wild.* towny.town.new uQuest.CanDropQuest iConomy.payment deathmessageplugin.sendmessage deathmessageplugin.getmessage jail.usercmd.jailstatus myhome.home.soc.invite giftpost.chest.everywhere Succes.

wat dus alemaal mooi onder elkaar moeten komen staan, en met ieder succes, zoiets:

Quote:
help Succes.
version Succes.
servertime Succes.
accept Succes.
players Succes.
essentials.sethome Succes.
essentials.home Succes.
essentials.list Succes.

//edit
moet er niet iets met while in?

en hij insert alles in 1 query sadley
0
Fass

Lid

Berichten
3.771
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Snabbotube schreef:
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700][[/COLOR]conection weggelaten[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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])) &&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])){[/COLOR]
    [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_split"]preg_split[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]/rn|r|n/[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$id[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
    [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$query[/COLOR][COLOR= #007700]){[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO prpermissions (permstring, entryid) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$query[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] Succes.<br />[/COLOR][COLOR= #007700];
   }
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
<form action="wouterrr.php" method="post">
Permissions:<br/>
<textarea name="text">
</textarea><br/>
Group ID:<br/>
<input type="text" name="id" /><br/>
<input type="submit" name="submit"/><br/>
</form>
[/COLOR][COLOR= #007700];
}[/COLOR]

?>
probeer es?
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])) &&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])){[/COLOR]
    [COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]n[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$id[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
    [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$query[/COLOR][COLOR= #007700]){[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO prpermissions (permstring, entryid) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$query[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] Succes.<br />[/COLOR][COLOR= #007700];
   }
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
<form action="wouterrr.php" method="post">
Permissions:<br/>
<textarea name="text">
</textarea><br/>
Group ID:<br/>
<input type="text" name="id" /><br/>
<input type="submit" name="submit"/><br/>
</form>
[/COLOR][COLOR= #007700];
}[/COLOR]
0
Wouterr

Lid · Topicstarter

Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Fassdfds je bent men held biggrin!
TY!
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