Kleine Vragen Topic #1

Gestart doorLennard4.284 reacties15.585 weergaven

4.285 berichten · pagina 2 van 286

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maartenl schreef:
tekst => tekst
En controleer met if("POST" == $_SERVER[REQUEST_METHOD])
+ waar is de button ?
toevoeging op 3 juni 2012, 111012:
geen or die(mysql_error());

De button moet je ff scrollen naar rechts.
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bjarnootjuh schreef:
Eerdere citaten tonen
Maartenl schreef:
tekst => tekst
En controleer met if("POST" == $_SERVER[REQUEST_METHOD])
+ waar is de button ?

toevoeging op 3 juni 2012, 111012:
geen or die(mysql_error());

De button moet je ff scrollen naar rechts.
Had ik niet gezien, sorry.
0
Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hij werkt nu half, geen error meer maar hij past het niet aan. Hij zegt wel dat het is gelukt maar blijft hetzelfde:

[COLOR= #0000BB]<?php[/COLOR] 
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/COLOR][COLOR= #007700]])) 
  {[/COLOR] 
    [COLOR= #0000BB]$sVoornaam[/COLOR]        [COLOR= #007700]=[/COLOR]    htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]djzegt[/COLOR][COLOR= #007700]]);[/COLOR] 
     
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE djzegt SET tekst => "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sVoornaam[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
 
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]DJ zegt veranderd![/COLOR][COLOR= #007700]; 
  }[/COLOR] 
?> 
<form action="" method="POST"><br />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<input style="width:200px" placeholder="djzegt" type="text" name="djzegt" size="20" value="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$get_djzegt[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tekst[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />[/COLOR][COLOR= #007700];[/COLOR] ?> <input type="submit" name="verzenden" size="20" value="Update" />
</form>
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bjarnootjuh schreef:
Hij werkt nu half, geen error meer maar hij past het niet aan. Hij zegt wel dat het is gelukt maar blijft hetzelfde:
[COLOR= #0000BB]<?php[/COLOR] 
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/COLOR][COLOR= #007700]])) 
  {[/COLOR] 
    [COLOR= #0000BB]$sVoornaam[/COLOR]        [COLOR= #007700]=[/COLOR]    htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]djzegt[/COLOR][COLOR= #007700]]);[/COLOR] 
     
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE djzegt SET tekst => "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sVoornaam[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
 
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]DJ zegt veranderd![/COLOR][COLOR= #007700]; 
  }[/COLOR] 
?> 
<form action="" method="POST"><br />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<input style="width:200px" placeholder="djzegt" type="text" name="djzegt" size="20" value="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$get_djzegt[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tekst[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />[/COLOR][COLOR= #007700];[/COLOR] ?> <input type="submit" name="verzenden" size="20" value="Update" />
</form>


Doe is or die(mysql_error()); er achter bij de query dan zie je de fout.
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nielsie schreef:
substr(value, BeginNummer, EindNummer)

Als je dan als value Hoi hebt
En als beginnummer 0 hebt en eindnummer 1 krijg je als resultaat: H
Snap je? yummie
Niet echt, wat gebeurd er dan als ik dat weglaat?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Wat weglaat?

E: Misschien (Als je engels kanemo) heb je hier wat aan Substr();
0
Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Robertt schreef:
Eerdere citaten tonen
Bjarnootjuh schreef:
Hij werkt nu half, geen error meer maar hij past het niet aan. Hij zegt wel dat het is gelukt maar blijft hetzelfde:
[COLOR= #0000BB]<?php[/COLOR] 
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/COLOR][COLOR= #007700]])) 
  {[/COLOR] 
    [COLOR= #0000BB]$sVoornaam[/COLOR]        [COLOR= #007700]=[/COLOR]    htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]djzegt[/COLOR][COLOR= #007700]]);[/COLOR] 
     
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE djzegt SET tekst => "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sVoornaam[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
 
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]DJ zegt veranderd![/COLOR][COLOR= #007700]; 
  }[/COLOR] 
?> 
<form action="" method="POST"><br />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<input style="width:200px" placeholder="djzegt" type="text" name="djzegt" size="20" value="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$get_djzegt[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tekst[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />[/COLOR][COLOR= #007700];[/COLOR] ?> <input type="submit" name="verzenden" size="20" value="Update" />
</form>

Doe is or die(mysql_error()); er achter bij de query dan zie je de fout.

Dit is de error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near tekst => Leuk dat je luistert at line 1
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Wat betekend > ook alweer?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Meer dan >
Minder dan <
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR] 
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/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/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/COLOR][COLOR= #007700]])) 
  {[/COLOR] 
   
    [COLOR= #0000BB]$updateQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE djzegt SET tekst = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]djzegt[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$updateQuery[/COLOR][COLOR= #007700])
    {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Error: [/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]DJ zegt veranderd![/COLOR][COLOR= #007700]; 
    }
  }[/COLOR] 
?> 
<form action="" method="POST"><br />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<input style="width:200px" placeholder="djzegt" type="text" name="djzegt" size="20" value="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$get_djzegt[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tekst[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />[/COLOR][COLOR= #007700];[/COLOR] ?> <input type="submit" name="verzenden" size="20" value="Update" />
</form>


Dit?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Kijk, om deze reden heeft dit topic geen nut... Je had nu beter een nieuw topic aan kunnen maken, dat was veel overzichtelijker...

Maar ik zal wel gek zijn.
0
Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sebastiaanh schreef:
[COLOR= #0000BB]<?php[/COLOR] 
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/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/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/COLOR][COLOR= #007700]])) 
  {[/COLOR] 
   
    [COLOR= #0000BB]$updateQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE djzegt SET tekst = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]djzegt[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$updateQuery[/COLOR][COLOR= #007700])
    {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Error: [/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]DJ zegt veranderd![/COLOR][COLOR= #007700]; 
    }
  }[/COLOR] 
?> 
<form action="" method="POST"><br />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<input style="width:200px" placeholder="djzegt" type="text" name="djzegt" size="20" value="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$get_djzegt[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tekst[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />[/COLOR][COLOR= #007700];[/COLOR] ?> <input type="submit" name="verzenden" size="20" value="Update" />
</form>
Dit?

Bedankt! Nu werkt hij wel wink
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Als je van een array een random wilt nemen, dan geef je toch eerst die arrays een waarde met foreach? Of hoe moet ik dit anders doen?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sanderc schreef:
Als je van een array een random wilt nemen, dan geef je toch eerst die arrays een waarde met foreach? Of hoe moet ik dit anders doen?
Google aahhttp://php.net/manual/en/function.array-rand.php
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sanderc schreef:
Als je van een array een random wilt nemen, dan geef je toch eerst die arrays een waarde met foreach? Of hoe moet ik dit anders doen?
Of je doet iets als dit:

[COLOR= #0000BB]<?php
$array[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]lol[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]mol[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]trol[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$array[/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]$array[/COLOR][COLOR= #007700]) -[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])];[/COLOR]
?>
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