So ive been at this for hours trying to get my editindex.php to update to my home table in mysql. So ive created a form which displays all the information I have in the colmns in the database and have all these in textarea so the user can edit the homepage information and then click update and it should change the homepage information. But when I go to update it gives me no errors but doesnt update the homepage.. Below is my index.php which shows all info in a form in textarea and editindex.php which the form is sent to, hopefully update my database.
index.php Head
<?php
include('../connect.php');
$query = "SELECT * FROM home";
$display = mysql_query($query) or die (mysql_error());
?>
Body
<?php
$i=0;
$num = mysql_numrows($display);
$id = mysql_result($display, 0, 'id');
$h1 = mysql_result($display, 0, 'h1');
$p1 = mysql_result($display, 0, 'p1');
$p2 = mysql_result($display, 0, 'p2');
$img1 = mysql_result($display, 0, 'img1');
$h2 = mysql_result($display, 0, 'h2');
$p3 = mysql_result($display, 0, 'p3');
$li1 = mysql_result($display, 0, 'li1');
$li2 = mysql_result($display, 0, 'li2');
?>
<form enctype='multipart/form-data' action='editindex.php' method='POST'>
Heading 1: <textarea name="h1" id="h1" rows="5" cols="40"><?php echo $h1;?></textarea><br/><br/><br/>
Paragraph 1: <textarea name="p1" id="p1" rows="5" cols="40"><?php echo $p1;?></textarea><br/><br/><br/>
paragraph 2: <textarea name="p2" id="p2" rows="5" cols="40"><?php echo $p2;?></textarea><br/><br/><br/>
Image 1: <textarea name="img1" id="img1" rows="5" cols="40"><?php echo $img1;?></textarea><br/><br/>
Heading 2: <textarea name="h2" id="h2" rows="5" cols="40"><?php echo $h2;?></textarea><br/><br/><br/>
Paragraph 3: <textarea name="p3" id="p3" rows="5" cols="40"><?php echo $p3;?></textarea><br/><br/><br/>
Line 1: <textarea name="li1" id="li1" rows="5" cols="40"><?php echo $li1;?></textarea><br/><br/><br/>
Line 2: <textarea name="li2" id="li2" rows="5" cols="40"><?php echo $li2;?></textarea>
<input name='id' id="id" value=$id hidden/>
<input type='image' img src='../img/update.png' border='0' height='50px' alt='Update'/>
</form>
editindex.php head
<?php
include('../connect.php');
$id = $_POST['id'];
$updateh1 = $_POST['h1'];
$updatep1 = $_POST['p1'];
$updatep2 = $_POST['p2'];
$updateimg1 = $_POST['img1'];
$updateh2 = $_POST['h2'];
$updatep3 = $_POST['p3'];
$updateli1 = $_POST['li1'];
$updateli2 = $_POST['li2'];
$query = "Update home set h1='$updateh1', p1='$updatep1',p2='$updatep2',h2='$updateh2',p3='$updatep3',li1='£updateli1',li2='$updateli2',img1='$updateimg1' WHERE id='$id'";
$display = mysql_query($query) or die(mysql_error());
?>