NielsJanssen
New Member
- Messages
- 148
- Reaction score
- 0
- Points
- 0
i made a script that is supposed to add content to a mysql database. the problem is that i keep getting an error: Duplicate entry '' for key 1
could someone please tell me what i am doing wrong???
this is the script i use
could someone please tell me what i am doing wrong???
this is the script i use
PHP:
<html>
<head>
<title>MP3 UPLOAD SYSTEM
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.box {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
border: 1px solid #000000;
}
-->
</style>
</head>
<body>
<?
if(isset($_POST['upload'])){
include 'library/config.php';
include 'library/opendb.php';
$query = "INSERT INTO tbl_Main (mainTitle, mainDate, mainContent ) ".
"VALUES ('$mainTitle', '$mainDate', '$mainContent')";
mysql_query($query) or die(mysql_error());
include 'library/closedb.php';
echo 'The content is added';
}
?>
<form action="" method="post" enctype="multipart/form-data" name="uploadform">
<table width="350" border="0" cellpadding="1" cellspacing="1" class="box">
<tr>
<td>Titel:
<td width="246">
<tr>Upload date:">
<tr>
<td>Content:
<td>
<td width="80" colspan="2" align="right">
</tr>
</table>
</form>
</body>
</html>
Last edited: