Re: Multiline data Insert Into table from a generated form?
| From: | Mike Smith | Date: | Thu, 03 Feb 2005 11:36:46 +0000 |
| Subject: | Re: Multiline data Insert Into table from a generated form? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207980@lists.php.net to get a copy of this message | ||
Change:
> while ($c=0;$c<count($_POST['tourid']):$c++)
to (change the : before $c++ to ;):
for ($c=0;$c<count($tourid);$c++)
I think i mentioned the while loop in my first reply. I should have said for.
(See: http://us2.php.net/for, http://us3.php.net/while,
http://us4.php.net/foreach)
I'm not sure what you mean by "form is posted to itself". Do you have
the function at the top of the page with the form? If so, you can do
something like
if($_POST['var']){
add_to_database( $tourid, $dayno, $fromto, $bld, $descrip,
&$dberror)
//ideally you'd forward to another page to let the user know the form
was received OK...
} else {
//Show form
}
Please post any specific error message you may get, not just "a parse
error", it will save my eyes!
Thanks,
Mike