Jump to content

NuzhatAhmed

New Members
  • Posts

    2
  • Joined

  • Last visited

NuzhatAhmed's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, Thank you for your reply! I am just a little confused on how it will update the time an date for that row only? I knwo it has the ID but what do I have to put in the html table for this to work? also what does bind the value mean? Any advice would be appreciated. Thanks again!
  2. What I want to do is update the date/time field when the check box or a button is selected for that specific row only. on clicking the button it should get the current date and time and store it into the database in the date/time field. Is this possible to do? here is a snapshot of my code so far. <?php $query1 = "SELECT * FROM software"; $result1 = mysql_query($query1); $id = $row['SoftwareID']; $time = time(); $timestamp = $_POST[date('Y-m-d H:i:s', $time)]; $query2 = "UPDATE software SET timestamp = '$timestamp' WHERE SoftwareID = '$id'" ; ?> <br> <table border ="1" width="justified" <tr> <th><center>Version Number </th></center> <th><center>Defect Number</th> <th><center>Description</th> <th><center>Date/Time</th> <th><center>Ready?</th> </tr> <?php while ($row = mysql_fetch_array($result1)) { $versionnumber = $row['VersionNumber']; $defectnumber = $row['DefectNumber']; $description = $row['Description']; $timestamp = $row['timestamp']; ?> <tr> <td><?php echo $versionnumber; ?></td> <td> <?= $defectnumber ?></td> <td> <?= $description ?></td> <form action="" method="post"> <td> <?= $timestamp ?></td> <td> <input type="submit" value="Submit Time"></td></form> </tr> <?php } ?> </table> </br> insert.php <?php include("databaseConnection.php"); $versionnumber = $_POST [versionnumber]; $defectnumber = $_POST [defectnumber]; $description = $_POST [description]; $qry = "INSERT INTO software (versionnumber, defectnumber, description) VALUES ('$versionnumber','$defectnumber','$description')"; $result = mysql_query($qry); if ($result) { echo "information submitted, "; header("location: developer_dashboard.php"); exit(); } else { die("There was an error, try again later"); } ?>
×
×
  • 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.