Nieuw lid |
|
Hallo allemaal,
ik heb een probleem met de UPDATE functie.
Wie zou me kunnen helpen?
hier onder is het script:
afrika.php
<?
include ("database.php");
$res = mysql_query("SELECT afrika FROM bestemming");
while ($arr = mysql_fetch_assoc($res)) {
?>
<html>
<head>
<title>Admin - Bestemming Afrika</title>
<LINK HREF="style.css" REL="stylesheet" TYPE="text/css">
</head>
<form method="post" action="edit_afrika.php" enctype="multipart/form-data">
<table border="0">
<tr>
<td class="admin_h2"> Bestemming Afrika informatie : </td>
</tr>
<tr>
<td class="rij"><html>
<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas"
});
</script><textarea name="afrika" cols="60" rows="25" border="1"><?echo $arr["afrika"]." ";?></textarea>
</td>
<td><input type="hidden" name="action" value="edit"><input type="hidden" name="id" value="<? echo $arr["id"]; ?>"></td>
<td align="right"><input type="image" src="images/edit.bmp" value="Voltooien" alt="Film wijzigen"><a href="admin.php"><img border="0" src="images/annuleren.bmp" alt="Annuleren">
</tr>
</table>
<?
}
mysql_free_result($res);
?>
<? include ("database.php"); ?> <html> <head> <title>Admin - Bestemming Afrika</title> <LINK HREF="style.css" REL="stylesheet" TYPE="text/css"> </head> <form method="post" action="edit_afrika.php" enctype="multipart/form-data"> <table border="0"> <tr> <td class="admin_h2"> Bestemming Afrika informatie : </td> </tr> <tr> <td class="rij"><html> <script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ mode : "textareas" }); </script><textarea name="afrika" cols="60" rows="25" border="1"> <? echo $arr["afrika"]." ";? ></textarea> </td> <td><input type="hidden" name="action" value="edit"><input type="hidden" name="id" value=" <? echo $arr["id"]; ?>"></td> <td align="right"><input type="image" src="images/edit.bmp" value="Voltooien" alt="Film wijzigen"><a href="admin.php"><img border="0" src="images/annuleren.bmp" alt="Annuleren"> </tr> </table> <? } ?>
edit_afrika.php
<?
include ("database.php");
$query = "UPDATE bestemming SET afrika= ."$afrika." WHERE id=1";
mysql_query($query) or die (mysql_error());
?>
<? include ("database.php"); $query = "UPDATE bestemming SET afrika= ."$afrika." WHERE id=1"; ?>
|