Jump to content

retrive textbox data from data base


Jouatt

Recommended Posts

I have a form that the user will check off a checkbox if they finish with everything and that checkbox updates the database field "TripMade" with either a 1 if checked or a 0 if not checked. This is working fine but i wish to be able to see if the box is checked or not from another page with a checkbox. This is what i have sofar to populate the checkbox with the data from the database but it is not working.

<?
include "include/session.php";

include "include/z_db.php";
?>
<?

require "bottom.php";
?>
<!doctype html public "-//w3c//dtd html 3.2//en">

<html>

</head>

<!-- <body bgcolor="#339999"> -->
<body bgcolor="white">
<!--  <form action="index.php" method="post">
<br /><input type="submit" value="HOME" ;/></form><br />  -->

<img src="logo.jpg" width="197" height="193" align="right"><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br />
<FORM>
<INPUT TYPE="BUTTON" VALUE="New Tour" ONCLICK="window.location.href='http://www.integranite.net/EAToursDemo/Input.php'">
</FORM>
<?php
$result = mysql_query("SELECT * FROM Project1");

echo "<table border='1'>

<tr>
<th>School</th>
<th>Teacher</th>
<th>First Contact start date</th>
<th>Development Start</th>
<th>Development End</th>
<th>Pricing Start</th>
<th>Pricing End</th>
<th>Marketing Start date</th>
<th>Price Based On</th>
<th>Trip Assigned To</th>
<th>Trip Made</th>
<th>Notes</th>
</tr>";

while($row = mysql_fetch_array($result))
//$TripMade =  (($row['TripMade'] == 1) ? ' checked="checked"' : null);
{ 
$checkbox = '';
if ($Row['TripMade'] == 1) $checkbox = ' checked'; 
echo "<tr>";

echo "<td>" .$row['School'] . "</td>";
echo "<td>" .$row['Teacher'] . "</td>";
if(!strcmp($row['dtFirstContactSt'], '0000-00-00')) {
echo "<td>" . "No Date </td>";
} else {
echo "<td>" .$row['dtFirstContactSt']. "</td>";
}
if(!strcmp($row['dtDevelopmentSt'], '0000-00-00')) {
echo "<td>" . "No Date </td>";
} else {
echo "<td>" .$row['dtDevelopmentSt']. "</td>";
}
if(!strcmp($row['dtDevelopmentEnd'], '0000-00-00')) {
echo "<td>" . "No Date </td>";
} else {
echo "<td>" .$row['dtDevelopmentEnd']. "</td>";
};
if(!strcmp($row['dtPricingSt'], '0000-00-00')) {
echo "<td>" . "No Date </td>";
} else {
echo "<td>" .$row['dtPricingSt']. "</td>";
}
if(!strcmp($row['dtPricingEnd'], '0000-00-00')) {
echo "<td>" . "No Date </td>";
} else {
echo "<td>" .$row['dtPricingEnd']. "</td>";
}
if(!strcmp($row['dtMarketingSt'], '0000-00-00')) {
echo "<td>" . "No Date </td>";
} else {
echo "<td>" .$row['dtMarketingSt']. "</td>";
}
echo "<td>" .$row['PriceBasedOn']. "</td>";
echo "<td>" .$row['TripAssignedTo']. "</td>"; 
?>
<td><input type="checkbox" name="TripMade" value="Yes" <?= $checkbox ?>>
<td><textarea name="Notes" rows="1" cols="10"><?php echo $row["Notes"]?></textarea> </td>
<?php
//echo "<td>" .$row['Notes']. "</td>";
echo "<td>" . "<a href=Edit_Form.php?UniqueIdentifier=$row[uniqueIdentifier]> Edit </a></td>";

echo "</tr>";
}

echo "</table>";
mysql_close($con);
?>

<br />

<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>

<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<center>


</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/207653-retrive-textbox-data-from-data-base/
Share on other sites

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.