Hello People,
Bit further on with this if anyone can help?
With this code i'm trying to move stories from a news table to an archive table with exactly the same database structure as each other:
<?php
// login stuff
include("../**********.php");
include("../**********.php");
# if form is submitted.....
if(isset($_POST['Submit'])) {
echo 'form posted succesfully';
echo '<pre>';
print_r($_POST);
echo '</pre>';
foreach($_POST['d'] as $value) {
mysql_query("insert into archive select * from news where news.newsid = '$value'; delete from news where news.newsid = '$value'");
}
}
# query to get records.....
$result = mysql_query("select * from news",$link) or die(mysql_error());
?>
<body bgstyle="color:#FFFFFF">
<form name="form1" method="post" action="">
<table width="100%" cellpadding="1" cellspacing="1" bgstyle="color:#999999">
<tr bgstyle="color:#CCCCCC">
<td width="6%" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font><span class="brown_bold">No:</span></td>
<td width="94%" valign="middle" class="light_blue"><b class="blue_bold">News
Story:</b></td>
</tr>
<?php
#loop through the rocord
while($row = mysql_fetch_array($result, MYSQL_BOTH)){
?>
<tr bgstyle="color:#FFFFFF">
<td width="6%">
<input type="checkbox" name="d[]" value="<?php echo $row['newsid'];?>">
</td>
<td width="94%"><a href="news.php?newsid=<?php echo $row['newsid']?>"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo $row['headline'];?></font></a></td>
</tr>
<?php
}?>
<tr bgstyle="color:#FFFFFF">
<td width="6%"> </td>
<td width="94%">
<input type="submit" name="Submit" value="Send to Archive" class="button">
</td>
</tr>
</table>
</form>
</body>
</html>
It's being strange and thowing this up when I try to move a story:

...and the [0] => 1 changes to [0] => 2 etc depending on what story I try to move.
Trouble is it says 'form posted succesfully', but it has not...
Any ideas?
Thanks