Okay, my head is swimming as I've been trying to figure out what I'm doing wrong here. I am certain it's something stupid and I've tried different ways of putting it all in, but still no luck.
Basically, I am trying to make it so I can put in our crews for the shifts at work, which will be displayed on another page. (I have the display page working fine with some sample data.)
I will also go ahead and ask now...I am wanting to overwrite what I already have in there, so there is only one row in the database. Is this possible or am I going to have to delete rows every day? (Which may end up being a big pain since I only work a 3 day rotation.)
Anyhow...here is the main page. It's a little messy, but it works fine.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HCH EMS</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<!--[if IE]>
<style>
#head_container ul
{
margin-top: 56px;
}
#content_container
{
float: left;
}
</style>
<![endif]-->
</head>
<body>
<div id="top">
<div id="head_container">
<ul>
<li><a href="http://hchems.zymichost.com/index.php">Main</a></li>
<li><a href="#">Link</a></li>
</ul>
<a href="index.php" id="logo">HCH EMS Crews</a>
</div>
</div>
<div id="wrapper">
<div id="main_container">
<div id="menu_container">
<div class="content">
<h1> Crews </h1>
<p>
<a href="#">News</a>
<span>5/17/2012</span>
<br />
Example data
</p>
</div>
<div class="content">
<h1> Links </h1>
<ul>
<li><a href="#">Link Example</a></li>
</ul>
</div>
<div class="content">
<h1> Links2 </h1>
<ul>
<li><a href="#">Link Example</a></li>
</ul>
</div>
</div>
<div id="content_container">
<div class="content">
<h1> 24 Hour Crew </h1>
<form method="post" action="update.php">
Driver: <br />
<input type="text" name="Driver24" size="60" /><br />
Caregiver: <br />
<input type="text" name="Medic24" size="60" /><br />
</div>
</div>
<div id="content_container">
<div class="content">
<h1> Day Crew </h1>
Driver: <br />
<input type="text" name="DriverDay" size="60" /><br />
Caregiver: <br />
<input type="text" name="MedicDay" size="60" /><br />
</div>
</div>
<div id="content_container">
<div class="content">
<h1> Call Crew </h1>
Driver: <br />
<input type="text" name="DriverCall" size="60" /><br />
Caregiver: <br />
<input type="text" name="MedicCall" size="60" /><br />
<input type="submit" value="Update Crews" />
</form>
</div>
</div>
<div id="clear">
</div>
</div>
</div>
<div id="footer">
<!--
################# DO NOT REMOVE THE ZYMIC LINK! ################
If you remove this link to zymic.com, you risk legal action being
taken against you for infringing on our copyright on this design.
If you would like to remove the link legally, please visit
http://www.zymic.com/free-templates/copyright-removal/1135/
-->
Copyright © 2007 <a href="http://www.zymic.com/free-templates/">Free Templates</a> by <a href="http://www.zymic.com">Zymic</a> - <a href="http://www.zymic.com/free-web-hosting/">Free Web Hosting</a> - Best Viewed in <a href="http://www.mozillafirefox.us">Mozilla Firefox</a><br />
<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> | <a href="http://validator.w3.org/check/referer">XHTML</a>
</div>
</body>
</html>
And here is the simply little update file. Now...when I hit submit, it leaves the page, but then simply goes to a white page. I have tried an echo at the end and it does work, so it runs through, but will not write to the database and then just leaves me on a white page. I would like it to return to the display page if at all possible. If not, at least back to the same page I put the information in on. Any thoughts?
<?php
mysql_connect ("localhost", "731517_hchems", "9426333");
mysql_select_db ("hchems_zymichost_hch");
$query="INSERT INTO Crews (ID, Driver24, Medic24, DriverDay, MedicDay, DriverCall, MedicCall) VALUES('$_POST[Driver24]', '$_POST[Medic24]', '$_POST[DriverDay]', '$_POST[MedicDay]', '$_POST[DriverCall]', '$_POST[MedicCall]')";
mysql_query($query);
?>