Jump to content

help updating a mysql database with a form


waterwn1097

Recommended Posts

okay so here is the deal, I have an entire website completely set up with a registration page and the whole nine. 

Once a client has been registered i would like to be able to login to my admin page on my website and update some of the  values contained in that clients row so then they have their own page that has been uniquely updated.

<?php include_once("scripts/connect.php");
$message = '';
if ($_POST['state']) {
    $id = $_POST['id'];
    $contractlink = $_POST['contractlink'];
    $foliolink = $_POST['foliolink'];
    $status = $_POST['status'];
    $quote = $_POST['quote'];
    $deposit = $_POST['deposit'];
    $sql = mysql_query("UPDATE clients SET contractlink='$contractlink', foliolink='$foliolink', status='$status', quote='$quote', deposit='$deposit' WHERE id='$id'"); 
    $message = "The Customers Information has been updated.";
    }
?>

and here is the form code

<table width="600" align="center" cellpadding="5">
	<form action="adminin.php" method="post">
	<p><font color="red"><?php print("$message");?></font></p>

											
<tr>
      <td width="163"><div align="right">ID:</div></td>
      <td width="409"><input type="text" name="id" placeholder="ID" /></td>
    </tr>
    <tr>
      <td><div align="right">Contract Link:</div></td>
      <td><input type="text" name="contractlink" placeholder="Contract Link" /></td>
    </tr>
<tr>
      <td><div align="right">Folio Link:</div></td>
      <td><input type="text" name="foliolink" placeholder="Folio Link" /></td>
    </tr>
<tr>
      <td><div align="right">Quote:</div></td>
      <td><input type="text" name="quote" placeholder="Quote" /></td>
    </tr>
    <tr>
      <td><div align="right">Deposit:</div></td>
      <td><input type="text" name="deposit" placeholder="Deposit" /></td>
  <tr>
      <td><div align="right">Status:</div></td>
      <td><select name="status">
      <option value="Waiting On DJ">Waiting on DJ</option>
      <option value="Waiting On Customer">Waiting on Customer</option>
      </select></td>
    </tr>
        <tr>
      <td><div align="right"></div></td>
      <td><input type="submit" name="Submit" value="submit" /></td>
    </tr>		</form>
    
</table>

the problem I am having is that the data is not updating. What am I doing wrong?

 

thank you all!

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.