Jump to content

[SOLVED] why wont this update the database? no error message


nelquintin

Recommended Posts

why wont this update the database?

<?
include("include/session.php");
?>
<?
$propertyid=$_GET['propertyid'];
$query=" SELECT * FROM propertys WHERE propertyid='$propertyid'";
$result=mysql_query($query);
$num=mysql_num_rows($result);

$i=0;
while ($i < $num) {
$picture=mysql_result($result,$i,"picture");
$price=mysql_result($result,$i,"price");
....
$username=mysql_result($result,$i,"username");
?>
<form action="propertys_change_record.php" method="post">
<input type="hidden" name="ud_propertyid" value="<? echo "$propertyid" ?>"><br>
Image:<br> <input type="File" name="ud_picture" size="<? print "$picture"?>"><br>
Price:<br> <input type="text" name="ud_price" value="<? print "$price"?>"><br>
.......
Username:<br> <input type="text" name="ud_username" value="<? print "$username"?>"></br>
<br><input type="Submit" value="Update">
</form>

<?
++$i;
}
?>

 

and...

<?
include("include/session.php");
?>
<?php
$ud_propertyid=$_POST['ud_propertyid'];
$ud_picture=$_POST['ud_picture'];
...
$ud_username=$_POST['ud_username'];
mysql_query(" UPDATE propertys  SET picture='$ud_picture' ,price='$ud_price' ,ref='$ud_ref' ,type='$ud_type' ,erf='$ud_erf' ,description='$ud_description' ,bed='$ud_bed' ,bath='$ud_bath' ,gar='$ud_gar' ,username='$ud_username' WHERE propertyid='$ud_propertyid'");
echo "Record Updated";

?>
<br>
<a href="main.php">Back to main page</a>
</body>
</html>
<?
++$i;
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.