Hi;
I am new to the list and new to building databases using php and mysql.
I am a retired sociologist by trade and I have a fair amount of experience
working with data and that sort of thing, but I mostly worked with Access
and Front page. I am now seeing the limitations of these programs and
shifting over the PHP and Mysql. So far so good, but I am having a problem
getting a form to work the ways I want it to.
I would like to use this form for multiple functions.
First as an input form
Secondly as a output form that my case managers can review.
Thirdly I would liked the case managers to be able to update information in
the form, so I need a way for them to go to a page that has a drop down menu
of all clients and it allows them to pick one from the list and go in and
update this form.
I have enclosed the form below, can anyone help...
Old and tired and mostly confused.
John
<?php # Script - basicinfo22.php
// Set the page title and include the HTML header.
$page_title = 'Basic Information Display Page';
include ('include/header.html');
// End of Header
//connect to database
$conn = mysql_connect("localhost", "root", "becky") or die(mysql_error());
mysql_select_db("testDB",$conn) or die(mysql_error());
$query="SELECT * FROM client";
$result=mysql_query($query);
mysql_close();
<?php
$id=$_GET['id']; //unique id from the table
$conn = mysql_connect("localhost", "root", "becky") or die(mysql_error());
mysql_select_db("testDB",$conn) or die(mysql_error());
$query="SELECT * FROM client WHERE id=$id";
$result=mysql_query($query);
$rs=mysql_fetch_array($result);
?>
Now show the form:
First Name: <input type="text" value="<?php echo $rs['fname']; ?>" />
//insert form
<title>Basic Information Display Page</title>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>
<form method="POST">
<fieldset>
<legend>Enter your information in the form below:</legend>
<table width="990" height="525" border="2" bordercolor="#0000FF"
bordercolordark="#0000FF" bordercolorlight="#00FF00">
<tr>
<th width="315" scope="col" bgcolor="#99FFCC"><b>Student ID:</b>
<input type="text" name="student_id" size="20"><th width="242"
scope="col" bgcolor="#99FFCC"> Input Date: <input type="text"
name="input_date" size="15" maxlength="15" value=""></th>
</tr>
<tr>
<td><p><strong>Enter Name: First, </strong> <b>Last:</b><br>
<input type="text" name="fname" size="15" maxlength="15"
value="<?php echo $_POST['fname']; ?>">
First Name: <input type="text" value="<?php echo $rs['fname']; ?>"
/>
<input type="text" name="lname" size="30" maxlength="30" value="">
<br>
<br><b>Address:</b> <br>
<input type="text" name="address" size="40" maxlength="40"
value="">
</p>
<p><b>City, State, Zip Code</b> <br>
<input type="text" name="city" size="15" maxlength="15"
value="Pittsburgh"> ,
<input type="text" name="state" size="4" maxlength="4" value="PA">
<input type="text" name="zip" size="10" maxlength="20" value="">
<br>
<td valign="top"> <p><b>CTC Organization:</b><br>
<select size="1" name="ctcorg">
<option>Select One</option>
<option>Bloomfield Garfield Corp.</option>
<option>East End Cooperative Ministry</option>
<option>Mr. Ararat Community Activity
Center</option>
<option>Parental Stress Center</option>
<option>YouthPlaces</option>
</select></p>
<p> <b>Case Manager :</b><br>
<input type="text" name="cmanager" size="40" maxlength="40"
value="">
</p>
<p><b>Neighborhoods:</b><br>
<input type="text" name="neighborhood" size="40" maxlength="40"
value="">
</p>
<p> </p>
</tr>
<tr>
<td valign="top"> <p><b>Home Phone:</b> <br>
<input type="text" name="hphone" size="15" maxlength="40"
value="">
(555) 555-4444<b><br>
</b></p>
<p><b>Mobil Phone:</b> <br>
<input type="text" name="mphone" size="15" maxlength="40"
value="">
(444) 444-5555</p>
<p><b>Email Address:</b><br>
<input type="text" name="email" size="40" maxlength="40" value="">
</p>
</p> <p> </p>
</td>
<td valign="top"> <p><b>Notes:</b><br>
<textarea rows="7" name="notes" cols="37" tabindex="1"></textarea>
</tr>
</table>
</fieldset>
</form>
<div align="center">
<p></p>
<p>
<input type="submit" name="Submit" value="Enter Data" />
</p>
</div>
</form><!-- End of Form -->
<?php
include ('include/admin_footer.html'); // Include the HTML footer.
?>
The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/