Script/programmeertaal:
PHP - HTML
Probleem (duidelijke uitleg vereist):
Het probleem is, hij het nieuwe spel niet in de database.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<div class="game-info">
<h1>Voeg spel toe</h1>
<h2 align="justify">
<form method="post">
<strong>Naam spel : </strong><input type="text" class="input" name="naam" />
<strong>Categorie : </strong>
<select name="categorie" class="input">
<?php
$optie = mysql_query("SELECT `naam` FROM `categorien` ORDER BY naam ASC");
while($opties = mysql_fetch_assoc($optie)){
echo '<option>'.$opties['naam'].'</option>';
}
?>
</select>
<strong>Foto : </strong><input type="text" class="input" name="foto" />
<strong>Beschrijving : </strong><input type="text" class="input" name="beschrijving" />
<strong>Spel : </strong><input type="text" class="input" name="swf" />
<input type="submit" class="input2" value="Voeg toe" />
</form>
<?php
if($_POST[naam]){
$sql="INSERT INTO game (foto, naam, beschrijving, swf, categorie, datum) VALUES ('$_POST[foto]','$_POST[naam]','$_POST[beschrijving]','$_POST[swf]','$_POST[categorie]',NOW())";
mysql_query ($sql);
echo '<font color="green">De game '.$_POST[naam].' is succesvol toegevoegd !</font>';
}
?>
</h2>
</div>
|
|
|
Overige informatie:
hier kan je zien dat het niet werkt
Alvast bedankt voor uw hulp en tijd.
Laatst gewijzigd door Frenzo305 op 2011-05-18 22:34:45
18-05-2011 22:23
Dit topic is 174 keer bekeken door 29 verschillende leden
Reacties op: "Geen update in database"
1
Reageer op: "Geen update in database"
1