Jump to content

Updating Table - help on processing page


loren646

Recommended Posts

process2.jpg

 

The price (i.e. "11", "2999", "4959") is outputted to a text box.

 

The user will now change the price.

 

When the "Update" button is pressed i want the all the prices to be to be changed to the new ones. 

 

 

I need to help on figuring out how to code the process page. 

 

 

<?php


  mysql_connect("localhost","user","password");
  mysql_select_db("listing");
  $result2 = mysql_query("SELECT * 
                          FROM available
                          JOIN land
                          ON available.building = land.building
                          WHERE land.landlord = '$landlordselect'
                          ORDER by available.price ASC");
                         
echo "<table border='1'>
<tr>
<th>Building</th>
<th>Apartment #</th>
<th>Price</th>
<th># of Bedrooms</th>
<th>Move in</th> 
<th>Rented</th>
</tr>";
while($row = mysql_fetch_array($result2))
  {
  echo "<tr>";
  echo "<td>" . $row['building'] . "</td>";
  echo "<td>" . $row['apt'] . "</td>";
  ?>
  <form action="processpage.php" method="post">
   <td><input name="uprice[]" type="text" size="5" value="<?php echo( htmlspecialchars( $row['price'] ) ); ?>" /> </td>
  <?php
  echo "<td>" . $row['bedroom'] . "</td>";
  echo "<td>" . $row['movein'] . "</td>"; ?>
  <td><input type="checkbox" name="rent[]" value="yes"></td>
  <?php
  echo "</tr>";
  }
echo "</table>";
?>
   <p><input type="submit" value="Update"><p>
  </form>
<?php
mysql_close();
?>
 
Edited by fenway
code tags
Link to comment
Share on other sites

Guest
This topic is now 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.