Razzled Puma wrote:
> When I try to combine the three form variables into one
variable to submit and
> store in the database (not even sure if that's the right
way), I can't figure
> out how to make it work using the way DW is submitting
the form variables.
Your massive amount of code has been truncated in the process
of
transferring your post to the newsgroup server, so I can't
see your
form. However, the principle is very simple. You have done
things
correct in the insert query:
$date_event_from = $_POST["fromDateYr"]."-";
$date_event_from .= $_POST["fromDateMo"]."-";
$date_event_from .= $_POST["fromDateDay"];
$date_event_to = $_POST["toDateYr"]."-";
$date_event_to .= $_POST["toDateMo"]."-";
$date_event_to .= $_POST["toDateDay"];
The easy way to play ball with Dreamweaver's server behaviors
is to
select one field as populating the date. In other words, use
fromDateYr
and toDateYr in the update record server behavior dialog box.
Then add
this at the top of the page:
<?php
if ($_POST && isset($_POST["fromDateYr"]) &&
isset($_POST["toDateYr"])) {
$_POST["fromDateYr"] .=
"-$_POST[fromDateMo]-$_POST[fromDateDay]";
$_POST["toDateYr"] .= "-$_POST[toDateMo]-$_POST[toDateDay]";
}
?>
This has the effect of building the dates in MySQL format,
and
reassigning them to $_POST["fromDateYr"] and
$_POST["toDateYr"]. The
Dreamweaver server behavior then treats the dates correctly.
Note that there are no quotes around fromDateMo and the other
field
names inside the double-quoted string. Using quotes around
the keys of
array elements inside a double-quoted string causes a parse
error.
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/