I have created a simple little set of pages and a small mysql db that i use on my home server. I am having trouble creating a page that will allow me to update rows in my database. I can get the text areas to fill in but not update.
here is code for the page
PHP Code:
<?
include('header.php');
$dbname = 'supplies';
$con=mysql_connect("localhost","xxxx","xxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$boxes=$_POST['boxsel2'];
mysql_select_db($dbname,$con) or die(mysql_error());
$fquery = "SELECT * From generalitems WHERE boxnum ='$boxes'ORDER BY itemtype";
$result = mysql_query($fquery) or die(mysql_error());
// Check if button name "Submit" is active, do this
if($Submit){
for($i=0;$i<$count;$i++){
$sql1= mysql_query("UPDATE generalitems SET itemtype='$itemtype[$i]', item='$item[$i]', quantity='$quantity[$i]', datepurchased='$datepurchased[$i]', expiredate='$expiredate[$i]', description='$description[$i]', notes='$notes[$i]' WHERE id='$id[$i]'");
$result1=mysql_query($sql1);
}
}
if($result1){
header("location:boxmod.php");
}
mysql_close($con);
?>
I am not very concerned with security as this will not be hosted on the web. But any security problems noticed would also help. I havn't done any of this in about 4 years and its definatly not like riding a bike lol.
Thanks for any and all help.