Vraagje

Gestart doorPropje29 reacties74 weergaven

30 berichten · pagina 2 van 2

Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
CREATE TABLE IF NOT EXISTS `dj` (
  `id` int(255) DEFAULT 2,
  `dnaam` varchar(20) NOT NULL,
  `dbericht` varchar(20) NOT NULL
 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

shiny
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Id mag niet primary zijn. Is dat wel zo, dan mag je geen dubbele waardes hebben.
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ow, dat wist ik niet.bloos
EDIT:

MySQL Aangepast!
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Werkt nog steeds niet kan ik niet beter update gebruiken dat die veranderd?

want als ik zelfde id 2 det blijft die op de zelfde tekst dat komt omdat die boven aan staat in de databse

dus ik typ in josnl hoi
dan krijg ik dat weer
wil ik wat nieuws intypen
dus dit rik doei
dan krijg hetzelfde dan staat er dit
josnl hoi dat komt omdat die boven aan staat in de databse
als rik doei in de databse boven aan zit krijg ik dat weer
0
Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dan moet je hem telkens updaten.
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
welke code is dat okeweer?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Je kan ook gewoon steeds id omhoog doen en dan ORDER BY id DESC LIMIT 1 bij de pagina waar je het weer ophaalt. Dan kan je meteen loggen wat er allemaal in word gezet smile
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
en hoe doe je dat?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Hoe je het eerst deed, maar dan moet je dus niet je toevoegpagina veranderen, maar de pagina die de tekst weergeeft.
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
huh ik snap het niet? confused
kan jij het miscchien ff uitleggen?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Je hebt hier iets van toevoegen. Dit moet je weer terugzetten hoe het was. Inclusief de database.

Dan heb je ook nog iets van het weergeven van die tekst. Die moet je veranderen in wat ik zei. Simpeler kan ik het niet maken emo
0
Berichten
6.356
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/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/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700]))
  {[/COLOR]
    [COLOR= #0000BB]$aFouten[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]dnaam[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700])
      {[/COLOR]
        [COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Je hebt geen dj naam ingevuld[/COLOR][COLOR= #007700];
      }[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]dbericht[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700])
      {[/COLOR]
        [COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Je hebt geen bericht ingevuld[/COLOR][COLOR= #007700];
      }[/COLOR]
      
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
          {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er zijn fouten gevonden:<br /><br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Fi[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$Fi[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$Fi[/COLOR][COLOR= #007700]++)
              {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$Fi[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
              }[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />Klik <a href="javascript:history.go(-1);">hier</a> om terug te keren[/COLOR][COLOR= #007700];
          }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
          [COLOR= #007700]{[/COLOR]
           [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE dj SET dnaam="[/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]dnaam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" , dbericht="[/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]dbericht[/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]  
          [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je hebt succesvol een dj bericht gestuurd"[/COLOR][COLOR= #007700];
          }
      
  }[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
  [COLOR= #007700]{[/COLOR]
?>
<h3>dj bericht</h3>


<form action="" method="POST">

<table border="0">
<tr>
<td width="100">Je dj Naam:</td>
<td width="100"><input type="text" name="dnaam"></td>
</tr>
<tr>
<td>bericht:</td>
<td><input type="text" name="dbericht">
</tr>
<tr>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="verzenden" value="versturen"></td>
</tr>
</table>

</form>

[COLOR= #0000BB]<?[/COLOR]
  [COLOR= #007700]}[/COLOR]
?>
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dan krijg ik deze error

have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ) at line 1
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/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/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700]))
  {[/COLOR]
    [COLOR= #0000BB]$aFouten[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]dnaam[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700])
      {[/COLOR]
        [COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Je hebt geen dj naam ingevuld[/COLOR][COLOR= #007700];
      }[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]dbericht[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700])
      {[/COLOR]
        [COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Je hebt geen bericht ingevuld[/COLOR][COLOR= #007700];
      }[/COLOR]
      
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
          {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er zijn fouten gevonden:<br /><br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Fi[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$Fi[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$Fi[/COLOR][COLOR= #007700]++)
              {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$aFouten[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$Fi[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
              }[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />Klik <a href="javascript:history.go(-1);">hier</a> om terug te keren[/COLOR][COLOR= #007700];
          }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
          [COLOR= #007700]{[/COLOR]
           [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE dj SET dnaam = "[/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]dnaam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", dbericht = "[/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]dbericht[/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]  
          [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je hebt succesvol een dj bericht gestuurd"[/COLOR][COLOR= #007700];
          }
      
  }[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
  [COLOR= #007700]{[/COLOR]
?>
<h3>dj bericht</h3>


<form action="" method="POST">

<table border="0">
<tr>
<td width="100">Je dj Naam:</td>
<td width="100"><input type="text" name="dnaam"></td>
</tr>
<tr>
<td>bericht:</td>
<td><input type="text" name="dbericht">
</tr>
<tr>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="verzenden" value="versturen"></td>
</tr>
</table>

</form>

[COLOR= #0000BB]<?[/COLOR]
  [COLOR= #007700]}[/COLOR]
?>
0
Propje

Lid · Topicstarter

Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dankje wel iedereen het is me gelukt biggrin
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