Vragen topic van mij

Gestart doorJesper117 reacties633 weergaven

118 berichten · pagina 7 van 8

Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/ini_set"]ini_set[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]display_errors[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]On[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[COLOR= #007700]);[/COLOR]


[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]database.php[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<h1>Categorie veranderen</h1>[/COLOR][COLOR= #007700];[/COLOR]




[COLOR= #0000BB]$sqla[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM categorie ORDER BY id DESC LIMIT 10"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$resa[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sqla[/COLOR][COLOR= #007700])) {[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<b>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$resa[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</b> | <b>ID: "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$resa[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]"</b> <br />"[/COLOR][COLOR= #007700]; 
}[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]]==[/COLOR][COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700]) {[/COLOR]


        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE categorie SET categorie="[/COLOR][COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]" WHERE id="[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Succesvol veranderd! <a href="index.php">Klik hier</a>[/COLOR][COLOR= #007700];
}[/COLOR]


?>

<form method="post" action="cveranderen.php">
ID: <input type="text" name="id" /><br />
Naam: <input type="text" name="categorie" /><br />
<input type="submit" name="submit" value="Verwijder" />
</form>


Zo goed aarclay?
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nu heb je helemaal geen foutafhandeling.. emoEn je uitlijning is als.. tjah.
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oh ja ik las het even niet. emoIk zat bij je query te kijken.
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ok.

toevoeging op 19 februari 2012, 20:30:09:
Nog een andwoord op me vraag?
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik gebruik zelf ook mysql_error() yummieAch, ik kan er mee leven en kan het altijd nog aanpassen. biggrin
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Een betere tut die meer is gericht op foutafhandeling in queries:

http://www.phphulp.nl/php/tutorial/data-verwerking/foutafhandeling-query-sql/735/voorbeeld-1-het-ophalen-van-gegevens/1931/

De volgende keer dat ik nog een keer een query van je zie, zonder foutafhandeling, dan geef ik je een draai om de oren wink.
Ik word nu al bang redface
[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/ini_set"]ini_set[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]display_errors[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR] 
    [URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL [COLOR= #007700]|[/COLOR] E_STRICT[COLOR= #007700]);[/COLOR]



[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]database.php[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<h1>Categorie veranderen</h1>[/COLOR][COLOR= #007700];[/COLOR]




[COLOR= #0000BB]$sqla[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM categorie ORDER BY id DESC LIMIT 10"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$resa[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sqla[/COLOR][COLOR= #007700])) {[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<b>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$resa[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</b> | <b>ID: "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$resa[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]"</b> <br />"[/COLOR][COLOR= #007700]; 
}[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]]==[/COLOR][COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700]) {[/COLOR]


        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE categorie SET categorie="[/COLOR][COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]" WHERE id="[/COLOR][COLOR= #007700].[/COLOR]  [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Succesvol veranderd! <a href="index.php">Klik hier</a>[/COLOR][COLOR= #007700];
}[/COLOR]


?>

<form method="post" action="cveranderen.php">
ID: <input type="text" name="id" /><br />
Naam: <input type="text" name="categorie" /><br />
<input type="submit" name="submit" value="Verwijder" />
</form>


Help plzzzz Ik ben je heeeeeel dankbaar thumbsup
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Lees die tutorial nou gewoon eens. Dat kan je nooit gedaan hebben in twee minuten.
4 paginas........................

Als je eventueel nog vragen hebt, dan horen we dat wel rond de klok van 21.00 uur ofzo.
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
emo
Help plzzzz Ik ben je heeeeeel dankbaar thumbsup (again)
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
MO-TI-VA-TIE!!!

Ik ben geen leermeester, en anders wil ik je wel helpen (voor 35 euro per uur).
Lees zelf gewoon eens, ik heb PHP ook zo geleerd door zelf wat te doen.

Als je te lui bent, moet je motivatie zoeken, en als je dat niet hebt, dan kan je beter een andere hobby zoeken.
Denk dat ik niet enige ben die dit vindt.

Ik ben benieuwd wanneer je kwartje eens gaat vallen?
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Laatmaar heb het al gevonden smile
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Goed zo.....

En je weet het hè, foutafhandeling of oorpijn wink....
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ahh, ik moet er niet aan denken cryswhip
Die smielis heb ik even aan elkaar gelast smile
toevoeging op 20 februari 2012, 07:56:40:

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/ini_set"]ini_set[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]display_errors[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL [COLOR= #007700]|[/COLOR] E_STRICT[COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$rQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM moppen WHERE aan=uit"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$rFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rQuery[/COLOR][COLOR= #007700])[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$rFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]];[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$rFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]];[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$rFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]];[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$rFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]mop[/COLOR][COLOR= #007700]];[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]

?>


Parse error: syntax error, unexpected T_ECHO in /home/uploaden/domains/manxi.nl/public_html/moppen/admin/aanvragingen.php on line 8

Hij is volgensmij wel goed hoor????

toevoeging op 24 februari 2012, 16:25:28:
Euh, hoe doe ik
if($_POST[huisnum] == >3) {
echo Je huisnummer is hoger dan het getal 3;
}

Als ik iets hoger dan 3 doe dan werkt het niet nopompom
toevoeging op 24 februari 2012, 16:25:56:
Euh, hoe doe ik
if($_POST[huisnum] == >3) {
echo Je huisnummer is hoger dan het getal 3;
}

Als ik in het formulier zet: 238423 dan zet hij het gewoon in de database, hoe kan dit?
0
Jesper

Lid · Topicstarter

Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Euh, hoe doe ik
if($_POST[huisnum] == >3) {
echo Je huisnummer is hoger dan het getal 3;
}

Als ik in het formulier zet: 238423 dan zet hij het gewoon in de database, hoe kan dit? nopompom
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